Bonehead Move

Patrick Doyle wpdster at gmail.com
Wed Feb 14 12:17:34 UTC 2007


I'll add my $.02 to the "I don't have any suggestions to you for
recovering your data, but here's what I do to prevent me from shooting
myself in the foot" discussion....

I use the fact that, in bash, "!$" means "whatever was the last
argument on the previous command.  So, if I want to get rid of a bunch
of files, I typically do:

$ ls *~
<list of a bunch of files pops out here>
$ rm !$

Incidentally, this also prevents the mistake of accidentally putting a
space between the "*" and the "~" :-)

In your case, where you wanted to get rid of ./mydir, I would have done:
$ ls -d ./mydir
$ rm -rf !$

--wpd




More information about the users mailing list