Last I did that it removed Sudo before it got to any important files so I just got "permission denied" on everything.
Last time I did that, I thought I made a mistake in the command so I hit ctrl+c to stop it, and when I tried again, I found that it removed rm.
You're kidding right? sudo is the first thing it loads when running that command.
Bah! What a casual. If they were using a real distro like Suicide Linux, the first command would have been just fine.
I have never heard of Suicide Linux, now I wanna fire up a vm and try it in a docker image.
LPT: scarred of running accidentaly rm -rf --no-preserve-root /
or rm -rf ~/
?
Do sudo touch /-i
, touch ~/-i
and touch ./-i
in the most important directories you have. When you will type rm -rf /
accidentally, the -i
operator will be added in the command and rm
will ask you for confirmation to delete EVERY SINGLE FILE of the directory you're removing. Then, just abort with Ctrl-C
Explanation : touch
is used to change the "ladt modified" date of a file, without changing it's content. If the file doesn't exist, it creates it.
thanks for this. Also to add to the explanation. the "*" in the command will unfold into all the files including "-i" which will be interpreted a parameter instead of a file and will change rm to ask before deleting. Also I can see that not working for shells that expand files with paths to avoid command alternation.
Whatever you do with that command, don't do it on a production machine
''sudo rm -rf /nix/store'' -> impossible to delete *: read only partition
About Community
Members
Online