What happens if I run rm -rf without sudo?

October 23, 2025 3 answers
Asked by TechieTurtle84
I was trying to use the `rm -rf .` command but accidentally left out the dot, so I just ran `rm -rf`. Fortunately, it seems like nothing critical got deleted, just some browser history and settings. I'm using the latest Fedora and KDE version, if that's relevant. I'm wondering why it didn't delete more files like I expected. Is it possible that not using `sudo` protected my system?

Answers

CuriousCoder92
It looks like you wanted to run `rm -rf .` but ended up running `rm -rf` without specifying a directory. Without `sudo`, that command can only delete files in your user directory, which is probably why nothing serious happened. Always double-check your commands before executing them to prevent mishaps!
Reply to this answer
FileNinja001
To clarify, if you ran `rm -rf` without any additional arguments, it likely just looked for a file named 'rf' in your current directory and did nothing else. Make sure you provide the full context next time for accurate help!
Reply to this answer
LinuxGuru77
Yeah, since you didnโ€™t use `sudo`, the command could just delete files in your home directory and maybe in any mounted drives, like those you access through Dolphin. If there were no files to delete in those locations, youโ€™re safe. Good job on checking!
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions