Hacker News new | past | comments | ask | show | jobs | submit login

The better recommendation is to alias rm -i to del:

    alias del='rm -i'
And then get in the habit of using 'del' unless you really want a no-confirmation delete.

Then when you are on another computer or at someone else's shell you get:

    del: command not found
Instead of having a bunch of files silently deleted.



Another trick is to run

    touch —- -i 
In important directories. Then rm -rf * expands to rm -rf .... -i ... and you get the “are you sure” prompt.


This strategy will fail pretty badly if you're on someone else's computer using Windows or DOS, where 'del' is the delete command.


Does `del -rf /` do a lot on Windows?


I doubt it, but `del *` should do the same thing on both systems.


Except that on windows, "del" defaults to prompting "are you sure" when one types "del *".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: