Re: Bonehead Move

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14/02/07, Patrick Doyle <wpdster@xxxxxxxxx> wrote:
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 !$


This might just be the single most useful tip that I've seen on this
list in the two years that I've been subscribed. Thanks for that!

Dotan Cohen

http://lyricslist.com/lyrics/artist_albums/642/tal_bachman.html
http://datip.com


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux