[hcs-d] deleting files

John Hawkinson jhawk at MIT.EDU
Tue May 29 18:10:46 EDT 2012


Brandon Liu <brandon.k.liu at gmail.com> wrote on Tue, 29 May 2012
at 00:46:08 -0700 in <CAMUNgz1jJGUGKPEZgQb2+bLusjKJMebX8jC5JyOTVxt4TQjg=Q at mail.gmail.com>:

> `rm -i` will ask you for a confirmation before it deletes the file. A lot
> of people add the line `alias rm='rm -i'` to their .bashrc (or equivalent)

Even more people will strongly discourage this.

Depending on an alias is dangerous when you find yourself on a system
that lacks it. In this case, the failure is pretty bad -- you expect
rm to protect you and you get in the habit of using "rm *" and going
yes/no through the choices, and then one day you find yourself on a 
system without the alias (say, a new account; or helping a friend) and
then "rm *" deletes everything.

If you want to alias "delete" (or whatever) to "rm -i", then fine. But aliasing
commands to change their default behavior in ways that don't fail
safe is a very risky proposition.

--jhawk


More information about the hcs-discuss mailing list