Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for December 5, 2013
Deadline scheduling: coming soon?
LWN.net Weekly Edition for November 27, 2013
ACPI for ARM?
LWN.net Weekly Edition for November 21, 2013
alias rm='rm -i'
has saved me a number of times, and there is always rm -f to undo it if need be ... so the _point_ is that -i is not a strong restriction, no?
Shortening the rope (around RH's neck)
Posted Apr 3, 2009 21:07 UTC (Fri) by gmaxwell (subscriber, #30048)
So by accepting this bit of 'protection' against one particular failure mode you've increased your exposure to another.
(The preserve root thing seems like 100% win to me
Posted Apr 6, 2009 11:18 UTC (Mon) by vblum (guest, #1151)
Posted Apr 3, 2009 21:31 UTC (Fri) by mgh (guest, #5696)
However, I have become so accustomed to using this form that I then to do it by default and have accidently removed files I didn't mean to ....
alias rm="rm -i" ends up being worthless because it drives the average user mad. But alias mv="mv -i" has saved me a few times and the same with cp.
Posted Apr 3, 2009 21:35 UTC (Fri) by madscientist (subscriber, #16861)
Believe me it doesn't take more than one time of not having that alias around, for whatever reason, running "rm" with the expectation it will ask you before deleting anything, and destroying important work to realize what a bad idea this is.
Posted Apr 5, 2009 19:09 UTC (Sun) by jengelh (subscriber, #33263)
mv "$@" "~/.trash";
and let cron evict it time and again.
Posted Apr 6, 2009 11:28 UTC (Mon) by vblum (guest, #1151)
Anything that asks you before deleting will make you think, even if it's after typing "y" for the 15th time ("hm .... strange that I am still typing "y" although I was only going to delete two files ... hm ...")
As for the second point, of course I wouldn't think of figuring out what I actually wanted to delete after being asked by -i ... that completely defeats the purpose of a safety net (and maybe that is why many in the thread do not understand why rm -i is a good thing, because it can be used for the purpose of making a deliberate selection ...)
Posted Apr 3, 2009 22:07 UTC (Fri) by fmarier (subscriber, #19894)
For example, there are cases where I can see no good reason to be able to delete a specific directory (e.g. /, /bin, etc.). In fact, having done that by accident at some point, I would have preferred safer defaults.
That's why I decided to write safe-rm (http://www.safe-rm.org.nz) to blacklist certain directories and files. It's aliased to rm on my machine but I can always use "/bin/rm" if I really wanted to delete my /usr/lib.
Posted Apr 3, 2009 23:51 UTC (Fri) by nix (subscriber, #2304)
Posted Apr 4, 2009 7:17 UTC (Sat) by Cato (subscriber, #7643)
Posted Apr 5, 2009 1:58 UTC (Sun) by Simetrical (guest, #53439)
Posted Apr 5, 2009 11:56 UTC (Sun) by nix (subscriber, #2304)
Posted Apr 5, 2009 17:11 UTC (Sun) by JoeF (subscriber, #4486)
Posted Apr 7, 2009 13:44 UTC (Tue) by hmh (subscriber, #3838)
accidental deletion and read-only root filesystem
Posted Apr 9, 2009 23:37 UTC (Thu) by giraffedata (subscriber, #1954)
I also do daily automated backups. Deleting my home directory wouldn't be particularly severe for me.
Posted Apr 17, 2009 11:34 UTC (Fri) by Ross (subscriber, #4065)
This seems much more like something you should be able to do through permissions rather than
adding special logic to every application to "know" what files should not be changed. And of course
there _are_ times you do want to change them even if it is rare, so the tools must also have an
Posted Apr 4, 2009 15:21 UTC (Sat) by man_ls (guest, #15091)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds