Date: Sun, 17 Apr 2016 19:36:10 +0200 From: Polytropon <freebsd@edvax.de> To: Odhiambo Washington <odhiambo@gmail.com> Cc: User Questions <freebsd-questions@freebsd.org> Subject: Re: rm -rf -Mitigating the dangers Message-ID: <20160417193610.b5437205.freebsd@edvax.de> In-Reply-To: <CAAdA2WNqWACnjiUSHhYWL1nEj=YGPPURqJHsAcjaXYacziXsfg@mail.gmail.com> References: <CAAdA2WNqWACnjiUSHhYWL1nEj=YGPPURqJHsAcjaXYacziXsfg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 17 Apr 2016 20:10:11 +0300, Odhiambo Washington wrote: > With great power comes great responsibility and as such I think there > should be a wrapper around rm to warn sysadmins that what they are about to > do with -rf is dangerous, yes? If you see that the command line contains -f, "force", then you should already know what you're doing, as you're _intendedly_ avoiding any safety belts. A person _responsible_ for a system who starts entering the "rm" command line should know what he's doing, especially when operating in an environment where the command line is being used (instead of a TUI or GUI file manager that makes it less easier to do something stupid). But no matter what you do, there simply is no universal protection against fat fingers, lazy eyes, and tired brain cells. I know what I'm talking about. ;-) > Read input from sysadmin 3 times, looking strictly for their confirmation > before effecting the `rm -rf`. Lazy sysadmins annoyed by this security measure will write a wrapper around it, call it "rm", and make sure the command line arguments are provided three times identically. Problem solved. :-) A nice idea is to use "echo" instead of "rm" first, and check the output, if that is _really_ what you want to delete, and then, and _only then_, replace "echo" with "rm". > Could it be that what I am smoking/drinking is the issue here or I have > your support? LOL Is this because of the recent "rm -rf hoax"? http://serverfault.com/questions/587102/monday-morning-mistake-sudo-rm-rf-no-preserve-root http://meta.serverfault.com/questions/8696/what-to-do-with-the-rm-rf-hoax-question Because people love car analogies... we don't have spikes in the streets infront of traffic lights that empty the tires of a driver who wants to surpass the red light, and forcing him to exchange the tires when he _insists_ on crossing the red light doesn't make the idea any better. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160417193610.b5437205.freebsd>