DragonFly BSD
DragonFly submit List (threaded) for 2004-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: rm -I patch (Re: Protection from the dreaded "rm -fr /")


From: "Devon H. O'Dell" <dodell@xxxxxxxxxxxxxxx>
Date: Wed, 06 Oct 2004 08:35:59 +0200

Matthew Dillon wrote:
    I think I'll commit something like this to DragonFly (you might
    get patch errors w/ FreeBSD but this is the basic idea).

-Matt

From the hackers@ thread on FreeBSD:



Index: rm.1 =================================================================== RCS file: /cvs/src/bin/rm/rm.1,v retrieving revision 1.2 diff -u -r1.2 rm.1 --- rm.1 17 Jun 2003 04:22:50 -0000 1.2 +++ rm.1 6 Oct 2004 01:34:12 -0000 @@ -81,6 +81,11 @@ option overrides any previous .Fl f options. +.It Fl I +Request confirmation once if more then three files are being removed or if a +directory is being recursively removed. This is a less intrusive dumb-user +option then +.Fl i .It Fl P Overwrite regular files before deleting them. Files are overwritten three times, first with the byte pattern 0xff,

Not to be nitpicky, but this should have sed -i -e s/then/than/g


Additionally, I'd suggest a different monicker than ``dumb-user'' -- I've accidentally wiped several things several times with a screwed up rm -rf. Ok, you could argue that I'm not the smartest guy, but ... ;) Perhaps:

This is an option perhaps more suitable for reducing accidents than
. Fl i

--Devon



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]