3 ms·
"Run as the root user from the root directory, type in rm -r f * , and, at the stroke of the ENTER key, gone are all the files and directories. Recursively, eac
by Hexstream 17y ago
"Run as the root user from the root directory, type in rm -r f * , and, at the stroke of the ENTER key, gone are all the files and directories. Recursively, each directory deleting itself once its files have been deleted, right down to the very directory from which you entered the command: the snake swallowing its tail."
Actually that would be rm -rf * and it wouldn't delete /, the directory from which you entered the command, since with * you've selected all the directories in /, not itself. To do that you'd have to invoke rm -rf . or /, I believe. Though I'm not sure if after deleting all files the system will let you delete / itself? (moot point though)
Sorry if that was obvious to everyone...
- uninverted 17y agoActually, I don't think you can delete / at all on unix. It's its own parent.
- sho 17y agoI think they have disabled it in Ubuntu? But I believe it used to work, if it doesn't still, in other distros. I mean half the reason it's verboten to run as root is that you might accidentally type "rm -rf pics /". I am too afraid to find out, anyway.