undelete in FreeBSD?
Louis LeBlanc
FreeBSD at keyslapper.net
Sun Jul 24 14:32:57 GMT 2005
On 07/24/05 07:16 AM, Mario Hoerich sat at the `puter and typed:
> # 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.
I have to second this - every bit of it. Deleting files is not an
area you want to get sloppy in. I've been bitten even knowing rm
would get rid of these files for good. I once fatfingered a space
between a '*' and '.txt' and lost a weeks worth of code work in one
fell swoop. Trust me, it's a mistake you make once and kick yourself
for indefinitely.
Trust me, I tend to use rm very carefully now, re-reading the command
each time I use it.
And no, I don't believe I'm making the case for a "trash" function. I
think that would increase the chances of sloppiness. After the
incident mentioned above, I considered the trash function, and eventually
came to the same conclusions Mario mentioned above.
Lou
--
Louis LeBlanc FreeBSD-at-keyslapper-DOT-net
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
Please send off-list email to: leblanc at keyslapper d.t net
Key fingerprint = C5E7 4762 F071 CE3B ED51 4FB8 AF85 A2FE 80C8 D9A2
First study the enemy. Seek weakness.
-- Romulan Commander, "Balance of Terror", stardate 1709.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050724/06367635/attachment.bin
More information about the freebsd-questions
mailing list