From owner-freebsd-questions@FreeBSD.ORG Sun Jul 24 14:32:57 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6969316A41F for ; Sun, 24 Jul 2005 14:32:57 +0000 (GMT) (envelope-from leblanc@keyslapper.net) Received: from russian-caravan.cloud9.net (russian-caravan.cloud9.net [168.100.1.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1A6C43D48 for ; Sun, 24 Jul 2005 14:32:54 +0000 (GMT) (envelope-from leblanc@keyslapper.net) Received: from russian-caravan.cloud9.net (localhost [127.0.0.1]) by russian-caravan.cloud9.net (Postfix) with SMTP id 44F901587F for ; Sun, 24 Jul 2005 10:32:54 -0400 (EDT) Received: from keyslapper.net (250-119.customer.cloud9.net [168.100.250.119]) by russian-caravan.cloud9.net (Postfix) with ESMTP id 83B4215488 for ; Sun, 24 Jul 2005 10:32:53 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by keyslapper.net (Postfix) with ESMTP id 0227211579 for ; Sun, 24 Jul 2005 10:32:53 -0400 (EDT) Received: from keyslapper.net ([127.0.0.1]) by localhost (keyslapper.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 39030-03 for ; Sun, 24 Jul 2005 10:32:52 -0400 (EDT) Received: by keyslapper.net (Postfix, from userid 1001) id B871C11452; Sun, 24 Jul 2005 10:32:52 -0400 (EDT) Date: Sun, 24 Jul 2005 10:32:52 -0400 From: Louis LeBlanc To: freebsd-questions@freebsd.org Message-ID: <20050724143252.GB50696@keyslapper.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <20050721070434.254A11D930@imss.sgp.fujixerox.com> <200507231250.16501.bulk_mail@siegel-tech.net> <20050724051648.GA4119@Pandora.MHoerich.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9" Content-Disposition: inline In-Reply-To: <20050724051648.GA4119@Pandora.MHoerich.de> X-PGP-Key: http://www.keyslapper.net/~leblanc/leblanc-at-keyslapper-net.asc User-Agent: Mutt/1.5.9i X-Virus-Scanned: amavisd-new at keyslapper.net X-AntiVirus: Checked by Vexira Antivirus v1.5 Subject: Re: undelete in FreeBSD? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2005 14:32:57 -0000 --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--