Just to prove to experienced users that --preserve-root by default is a benefit:
I consider myself a seasoned Linux user. Been using Linux for more than a decade. I recently toasted a filesystem with rm -rf /. What I actually typed though was something like:
Looks safe? Look again, I forgot a semicolon after f=/path/to/somedir. Effectively that was the same as type rm -rf /. If you want to try this out and not toast your root file system do this:
And see what would have ran without the echo. I'm a lot more paranoid about typing rm as root now. I always stop before pressing the enter key. If you don't think you would ever type something like this, think about any scripts you may have written where you call rm with a variable. Are you sure the variable got set? I'm posting semi-anonymously out of embarassment. *hangs-head-in-shame*
Just to prove to experienced users that --preserve-root by default is a benefit:
I consider myself a seasoned Linux user. Been using Linux for more than a decade. I recently toasted a filesystem with rm -rf /. What I actually typed though was something like:
f=/path/to/somedir rm -rf $f/ ; some_command $f; cp something $f/somewhere
Looks safe? Look again, I forgot a semicolon after f=/path/to/somedir. Effectively that was the same as type rm -rf /. If you want to try this out and not toast your root file system do this:
f=/home/user; echo rm -rf $f/
then this:
f=
f=/home/user echo rm -rf $f/
And see what would have ran without the echo. I'm a lot more paranoid about typing rm as root now. I always stop before pressing the enter key. If you don't think you would ever type something like this, think about any scripts you may have written where you call rm with a variable. Are you sure the variable got set? I'm posting semi-anonymously out of embarassment. *hangs- head-in- shame*