Hacker News new | comments | show | ask | jobs | submit login
Protecting a directory from being accidentally erased by rm -rf * (commandlinefu.com)
7 points by xtacy on June 2, 2011 | hide | past | web | favorite | 2 comments



I guess the inverse of this is

cd <dir>; touch ./-rf


> cd <dir>; touch ./-rf

Ha! That is evil!

But I can counter it. Assuming we're using Bash:

$ alias rm="rm --"

Your move. ;-)

P.S. OTOH, the alias above also defeats the "touch ./-i" idea.




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

Search: