On 01/09/10 20:39, Lisa Muir wrote:
...
> I've been thinking about it, and wondering if it would be an idea to
> replace rm with a script based on mv to make it easier to recover from
> incidents like this. It gets complex when you consider the various
> commandline switches and then handling multiple files of the same name
> in wherever you move the files, missing folder context. Was thinking
> of moving files to a zapme folder in some location with a cron script
> to actually delete files or folders in zapme folders which are older
> than 1 week old.
>> Just curious to know if anyone has worked on anything like that before
> or seen anything like it in the online projects?
>
Well, nothing like as elaborate as that but I have had occasion to be
glad of an alias in Mandriva:
$ alias
...
alias rm='rm -i'
...
If I find I'm deleting files I didn't intend to, at least I get warned
first; if I find that I wanted to delete many files (so that -i would be
a nuisance) then I just kill it, use up-arrow and add a -f
Frank
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!