cancel
Showing results for 
Search instead for 
Did you mean: 
Acetech Flight Engineer
Flight Engineer
  • 380 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
Moderator
Moderator
  • 351 Views

Re: what if I fire command rm -rf /*

Jump to solution

@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

--
Principle Technical Marketing Manager, Red Hat Enterprise Linux
Red Hat Certified Engineer (100-000-264)

View solution in original post

Reply
Loading...
Flight Engineer Tracy_Baker Flight Engineer
Flight Engineer
  • 317 Views

Re: what if I fire command rm -rf /*

Jump to solution

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

Reply
Loading...
3 Replies
Flight Engineer Ricardo Flight Engineer
Flight Engineer
  • 377 Views

Re: what if I fire command rm -rf /*

Jump to solution

You sit in a very confortable chair, and cry. 

Reply
Loading...
Moderator
Moderator
  • 352 Views

Re: what if I fire command rm -rf /*

Jump to solution

@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

--
Principle Technical Marketing Manager, Red Hat Enterprise Linux
Red Hat Certified Engineer (100-000-264)

View solution in original post

Reply
Loading...
Flight Engineer Tracy_Baker Flight Engineer
Flight Engineer
  • 318 Views

Re: what if I fire command rm -rf /*

Jump to solution

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

Reply
Loading...
Join the discussion
You must log in to join this conversation.