0
rm -rf /
rm -rf /*
rm -rf --no-preserve-root /

We know those commands will delete all possible files in /, but what would happen to the files of the disks mounted on /media? Likewise, what would happen to the files within the symbolic links going to /media disks?

I know the command is dangerously destructive, especially on UEFI systems so I think I know the answer but I want to be sure.

Obviously, I'm not asking this because I want to try it, but just out of curiosity.

  • It'll rm any files mounted & accessible (to the user who ran the command assuming file-system is RW and not RO). What file-system they are on (local, remote, network, external) doesn't matter if the user as access rights & file-system is RW (not for example RO) – guiverc May 17 at 7:19
0

If you run that, Everything you can delete under /media is gone and all links to them will be broken.

If someone else has something mounted there. That's safe from your removal.

If you run it using sudo. Then everything is gone.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.