Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jul 2005 10:32:52 -0400
From:      Louis LeBlanc <FreeBSD@keyslapper.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: undelete in FreeBSD?
Message-ID:  <20050724143252.GB50696@keyslapper.net>
In-Reply-To: <20050724051648.GA4119@Pandora.MHoerich.de>
References:  <20050721070434.254A11D930@imss.sgp.fujixerox.com> <200507231250.16501.bulk_mail@siegel-tech.net> <20050724051648.GA4119@Pandora.MHoerich.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--gj572EiMnwbLXET9
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 07/24/05 07:16 AM, Mario Hoerich sat at the `puter and typed:
> # Aaron Siegel:
>=20
>=20
> [ there is no un-rm ]
> >
> > One option I have seen for creating your own restore is to create a scr=
ipt=20
> > that will move files you want to delete to a temporary directory, a "Tr=
ash=20
> > Bin". Then use your shells aliases to alias the script to the rm comman=
d.=20
>=20
> 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. =20
>=20
> A better way is to use a name like "[tT]rash" or "tt" (=3D[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.
>=20
> 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. =20
>=20
> 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=20
> *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.
>=20
> 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
--=20
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 =3D C5E7 4762 F071 CE3B ED51  4FB8 AF85 A2FE 80C8 D9A2

First study the enemy.  Seek weakness.
    -- Romulan Commander, "Balance of Terror", stardate 1709.2

--gj572EiMnwbLXET9
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQFC46aUr4Wi/oDI2aIRAnX2AJ9NotbvJtCaOfWhZuWv9uIh7wRmFwCfRchu
cwjl1j1HmpJkO0fZOzfbsR8=
=PgZh
-----END PGP SIGNATURE-----

--gj572EiMnwbLXET9--



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