cancel
Showing results for 
Search instead for 
Did you mean: 
Acetech
Flight Engineer Flight Engineer
Flight Engineer
  • 7,140 Views

what if I fire command rm -rf /*

Jump to solution

What will happen if I type a command rm -rf /*

                   - Is all files of root directory gets deleted

                                              or

                   - It won't be able to enter into that directory

                                              or

                    - If it is delete the all data then is it is possible to reproduce that data

 

Akash S. Solanke
0 Kudos
2 Solutions

Accepted Solutions
Scott
Starfighter Starfighter
Starfighter
  • 7,111 Views

@Acetech first, don't do that.

That command will do a recursive deletion of all the the directories under /.  It will delete all of /bin first, then /boot, then /dev, etc. etc.  At some point it'll delete something that will cause significant system errors and your machine will stop functioning.  After a reboot, for which you will probably have to hard-poweroff the machine, upon booting back up, it will likely not complete it's boot.

This is not really something you can repair.  Instead, you'd have to do a re-installation and once the machine is re-installed, access system backups to restore data onto it.

Not really a situation you want to be in.

-STM

View solution in original post

Tracy_Baker
Starfighter Starfighter
Starfighter
  • 7,077 Views

Try it! Create a virtual machine with a snapshot. Issue the command (with privleges) and see what happens. Then, when you've satified your curiosity, restore the virtual machine from the snapshot.

I just did it. I got a lot of "permission denied" messages and then it simply locked up. .I had to hard reboot.

Upon reboot, I got a grub rescue> prompt.

Reverted the snapshot and all was good!

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College

View solution in original post

3 Replies
Ricardo
Flight Engineer Flight Engineer
Flight Engineer
  • 7,137 Views

You sit in a very confortable chair, and cry. 

Scott
Starfighter Starfighter
Starfighter
  • 7,112 Views

@Acetech first, don't do that.

That command will do a recursive deletion of all the the directories under /.  It will delete all of /bin first, then /boot, then /dev, etc. etc.  At some point it'll delete something that will cause significant system errors and your machine will stop functioning.  After a reboot, for which you will probably have to hard-poweroff the machine, upon booting back up, it will likely not complete it's boot.

This is not really something you can repair.  Instead, you'd have to do a re-installation and once the machine is re-installed, access system backups to restore data onto it.

Not really a situation you want to be in.

-STM

Tracy_Baker
Starfighter Starfighter
Starfighter
  • 7,078 Views

Try it! Create a virtual machine with a snapshot. Issue the command (with privleges) and see what happens. Then, when you've satified your curiosity, restore the virtual machine from the snapshot.

I just did it. I got a lot of "permission denied" messages and then it simply locked up. .I had to hard reboot.

Upon reboot, I got a grub rescue> prompt.

Reverted the snapshot and all was good!

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Join the discussion
You must log in to join this conversation.