rm -rf ~ /foo
I realized after a second or so and hit CONTROL-C. Nothing seemed to have been deleted, so I think it may have been still winding up. rm -rf ~ /foo
I realized after a second or so and hit CONTROL-C. Nothing seemed to have been deleted, so I think it may have been still winding up.guess what i typed to remove it?
i lost a lot of work that day.
since then i developed the habit to always only use rmdir for directories, and first go into the directory to remove files with rm.
i also avoid rm * by finding some common parts like an extension that most files share.
i don't want rm * to be in my history where i might accidentally call it.
mv is a clever idea. rename to something safe, which can be undone if you get it wrong.
i use a similar approach when deleting a lot but not all files from a directory. i first move the files into a new directory, double check that every file is in the right place and then delete the new directory safely.
Whatever it got I never noticed. Maybe it was trawling through a bunch of build detritus in `~/.cpan` or something.