From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 08:10:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 46D9716A4CE for ; Mon, 4 Oct 2004 08:10:42 +0000 (GMT) Received: from storm.uk.FreeBSD.org (storm.uk.FreeBSD.org [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id B081043D1F for ; Mon, 4 Oct 2004 08:10:41 +0000 (GMT) (envelope-from mark@grondar.org) Received: from storm.uk.FreeBSD.org (uucp@localhost [127.0.0.1]) by storm.uk.FreeBSD.org (8.13.1/8.13.1) with ESMTP id i948AAi0067645; Mon, 4 Oct 2004 09:10:10 +0100 (BST) (envelope-from mark@grondar.org) Received: (from uucp@localhost)i948AAeS067644; Mon, 4 Oct 2004 09:10:10 +0100 (BST) (envelope-from mark@grondar.org) Received: from grondar.org (localhost [127.0.0.1])i9488gal006311; Mon, 4 Oct 2004 09:08:42 +0100 (BST) (envelope-from mark@grondar.org) Message-Id: <200410040808.i9488gal006311@grimreaper.grondar.org> To: Thomas David Rivers From: Mark Murray In-Reply-To: Your message of "Sat, 02 Oct 2004 21:54:27 EDT." <200410030154.i931sR348272@lakes.dignus.com> Date: Mon, 04 Oct 2004 09:08:41 +0100 Sender: mark@grondar.org cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 08:10:42 -0000 Thomas David Rivers writes: > If I'm remembering correctly - the historical way to > do this is to alias the "rm" command to something that > else that checks the arguments and complains appropriately > (and then executes /bin/rm.) Typically with just a shell > alias. That keeps you from accidently doing something. Yeah. $ alias rm="rm -i" and you get the annoying "confirm all deletes" behaviour. > Just thinking that putting extra "smarts" into a utility > isn't the typical "UNIXy" way to do this. Let each tool > do the one thing it does really well.. 'rm' removes; let > it remove. Right. There are SO many special cases here that rm cannot possibly catch them all: # cd / ; rm -rf foo/ * ^ This space is a typo. > I think, in the old "UNIX Review" magazine (what - almost > 15+ years ago now?) There was a couple of examples of this. Many others as well. "Windows' job is to prevent you from shooting yourself in the foot. With UNIX, the idea is to make damn sure that there is a hole in your foot with the greatest possible efficiency." (Paraphrased) I've typed "rm -rf *" in the wrong place. ONCE. I learned Unix-fu from that experience. Now, if I type "rm ", I wake up. M -- Mark Murray iumop ap!sdn w,I idlaH