To avoid catastrophic data loss, readers should NOT run this, nor any variations on it!
I would like to understand what does this command do:
sudo rm -rf/*
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
As presented, the command will give an error because of a typo.
sudo rm -rf/* [sudo] password for ___: rm: invalid option -- '/' Try 'rm --help' for more information.
Without the typo, the command would attempt to delete all files on the system. It would throw errors for some files, which are inherently undeletable, such as some contained in
/dev, or read-only file systems.
Although someone else has already indicated in comments how to correct it, I will not do so in this answer because it might cause some newbies to destroy their systems.
For more information about the
rm command, see
rm= remove files
-f= force (ie. don't ask for confirmation)
-rfto save typing.
/*= files to start removing; ie. start in / or root directory
sudoelevates privileges - so the user will have write permission to everything.
In summary, that command will delete every single file on your system without any sort of confirmation.
You can run
man rm to read the manual page for