Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jul 2005 07:16:48 +0200
From:      Mario Hoerich <lists@MHoerich.de>
To:        aj@siegel-tech.net
Cc:        freebsd-questions@freebsd.org
Subject:   Re: undelete in FreeBSD?
Message-ID:  <20050724051648.GA4119@Pandora.MHoerich.de>
In-Reply-To: <200507231250.16501.bulk_mail@siegel-tech.net>
References:  <20050721070434.254A11D930@imss.sgp.fujixerox.com> <200507231250.16501.bulk_mail@siegel-tech.net>

next in thread | previous in thread | raw e-mail | index | archive | help
# Aaron Siegel:


[ there is no un-rm ]
>
> One option I have seen for creating your own restore is to create a script 
> that will move files you want to delete to a temporary directory, a "Trash 
> Bin". Then use your shells aliases to alias the script to the rm command. 

Don't *ever* create aliases for rm(1).  rm's sole purpose in
life is to destroy files.  If you tame it, you'll eventually
adapt and rm with less caution.  There are lots of people who
eventually got bitten by that when working on a machine other
than their own.  

A better way is to use a name like "[tT]rash" or "tt" (=[move]
to trash).  That way, when working on a machine without your
script, you'll get a nice and friendly "command not found"
reminding you there's no safety catch.

I'm personally none too fond of this, though.  Unixoid systems
have quite a lot of ways to destroy files.  Trashes won't really
protect you from that.  Instead, they just give you a false
feeling of security, which merely encourages sloppiness.  

My own solution is actually quite simple:
I treat dangerous commands the same way I'd carry a deadly and
pretty annoyed snake: with my thoughts on the task at hand.
I read the command *before* I hit enter.  Not the one I 
*think* I've written, but the one I'm about to execute.
I also tend to tab-expand globs to see which files are
actually affected.

YMMV, though.

Cheers,
Mario



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050724051648.GA4119>