How not to start your Friday

$ sudo vim /etc/hosts

Enter some lovely vimlicious commands on the file, and then proceed with the accidental “:w ~”. That erroneous command, will unfortunately write the file as “~” to your current working directory.

So we obviously don’t want that silly “~” file in our lovely clean directory so we’ll go ahead and remove it.

Now watch this:

$ rm ~
rm: cannot remove `~': Is a directory

That doesn’t make sense, it should be a file. Oh well. “I don’t have to stuff around.” so I’ll just:

$ rm -rf ~

And then it slowly dawns….NOO!

CTRL+C,CTRL+C,CTRL+C,CTRL+C,CTRL+C...

And there you have it. A recursive delete on ALL my files in my home directory. Nice. I’ll spend the morning rebuilding my Dev environment.

Read More