[Gllug] Undelete...?

Matt Saunders matts at yoyo.org
Thu Feb 5 15:42:37 UTC 2004

My first post to this list - hi everyone. :-)

Sorry - I can't add to the previous suggestions of how to "undelete" but
I have some other thoughts.

On Feb 05, Daniel P. Berrange wrote:


> There are various levels of protection you can use, by setting up
> command aliases. For example, as root, always have
>   alias rm="rm -i"
>   alias mv="mv -i"
>   alias cp="cp -i"
> Of course, since you supplied '-f' that wouldn't help.
> So for even greater protection alias 'rm' to instead do a copy with
> backups:
> function rm {
>   if [ ! -d ~/.trash ]; then
>     mkdir ~/.trash
>   fi
>   mv --backup=numbered $@ ~/.trash
> }
> So instead of deleteing the files, 'rm' now simply moves them
> to the trash directory, renaming any files already there with
> ever increasing numbered suffixing.

The problem with that is that you'll then start to rely on being
prompted for confirmation each time you try to do something dangerous.
If you then find yourself on another UNIX machine, or if you reinstall,
and aren't aware that those aliases aren't present, then WHAM! "rm"
is back to its lethally dangerous self and you've deleted things you
expected to see a confirmation for.

One of my favourite things about the UNIX command-line is that things do
exactly what they say they will do.  If you tell it to remove a file it
will remove a file.  You have to treat it with respect. :-)

> Or just use a GUI file manager like Nautilus instead of the shell.
Sounds like a better idea to me if you want Windows-style safety nets as
there's no false sense of security to be lulled into. :-)

If I wanted to use the command-line tools with a safety net then I'd
give them different names, eg. "saferm" or "rmi" or something so it
doesn't bite you on the bum later.

> For networked storage, the AFS filesystem can be configured to take
> a daily file system snapshot &make that available, at ~/.yesterday

  Matt Saunders   http://www.yoyo.org/matts/contacts/
  "This is getting very silly. Too silly." 
                                   - Professor Yaffle

Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list