what happens when you type in rm / -rf in unix?
better type sudo also
Bad, bad things happen.
That would delete your whole filesystem, if you add the sudo Tomas mentioned.
would it really allow to delete with sudo? dont you have to type also --no-preserve-root?
Don't know. I've never tried. :P Much like I've never tried "cp /dev/null /" XD
i think its save to try with -i :D
Not sure, let me try.. Yeah right.
It would simply error. rm expects a file, not a directory, so without a -r switch BEFORE the argument, you have an error. I'm betting you don't have a file named -rf in your current directory. Clean up the syntax, and unless you have EUID 0, give it a try!
at the beginning i thought its incorrect either, but I have tried and it actually works even if you type argument after file name
Tomas is right, most implementations will accept that. However, there are some that won't. If I had to pick one that wouldn't, my guess would be Android shell. heh.
That's the beauty of Unix; you have tiny programs that each do something specific, and they do that thing well. Also, you can chain them up to solve lots of problems. How many files are in my computer? ls -R / | wc -w Not only are they simple (and usually open source) programs, but they are also very obedient; if Unix objects to any of your commands, just be root and it obeys! $ ./shootmyfoot I can't let you do that. $ sudo ./shootmyfoot Are you sure you want to shoot your own foot? Y/n: [enter] Kiss your foot goodbye! I like how Unix is set up with the assumption that the user is a King, rather than an idiot.
You'll come to appreciate how that extends to services too, or at least used to. One of the reasons that *nix security is better than Windows and OSX.
Join our real-time social learning platform and learn together with your friends!