Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Make SURE you type that in right, especially if you are root. It does not ask questions about what you are doing.
I had moved my Gentoo to a new hard drive and I booted the old drive and typed in rm -rf /* just to see what it would do. It ran until it deleted something that it needed then errored out. About 90% of the files were gone, I think it was something in /usr/sbin. Trust me, it will delete what you tell it, even if you tell it wrong.
rm -r alone doesn't work because by default rm doesn't remove directories - only their contents and tells you it can't remove a directory because it is a directory. The -f flag says to disregard all warning conditions and force the remove.
As pointed out by others it is useful for removing an entire directory tree but can be very dangerous if you don't use it correctly.