What happened by running 'rm-rf/'

Asked 2 years ago, Updated 2 years ago, 41 views

I accidentally ran rm-rf/ while practicing deleting directories with the command.

I would like you to let me know the following two points.

Details below
I am studying ruby on rails.
I used xcode and homebrew to build the environment.

There were apps such as chrome and personal files left, so
 I didn't know what had disappeared.

I thought that the construction of the environment blew away because the rails command didn't go through.
 I resumed from where I put in the xcode, but it didn't seem to have disappeared.
 I resumed when I put in homebrew.

Currently, restoration work is underway.
 I looked into the configuration of the root directory
 Because I couldn't consider what had disappeared
 I asked you a question.
 It may be difficult for individuals to answer where and what they store, but
 It doesn't matter if it's like "The app that the user personally put in has disappeared"
 I would appreciate it if you could let me know


You can't enter control+c immediately with about 20 lines from the top.  I ran control+c in the fast display of operation not permitted

Enter a description of the image here

Thank you for your cooperation.

macos

2022-09-30 19:29

2 Answers

I'm not familiar with macOS-specific behavior, but if I were to talk about general Linux,

    When executing the
  • rm command, you can optionally specify -i or -v to display the filename during deletion, but you cannot check which files were deleted after the actual deletion.
    (Therefore, you should be careful when using commands.)

  • /You must have administrator (root) privileges to manipulate (=edit including deletion) the directory group directly below.
    Unless you run the rm command with administrator privileges, you may have deleted the following personal files with user privileges: /home/<USER> or files created under /tmp/.
    Other than these, as you see errors such as Permission denied, they should have been played with permissions and not deleted.

  • As far as we've tried "simple sample environment = just putting multiple files under a single directory", if multiple files are to be manipulated, they appear to be processed in approximate file name dictionary order (a-z).
    However, there is no certainty as to what happens when the hierarchy handles deep lists.

When executing the rm command, you can optionally specify -i or -v to display the filename during deletion, but you cannot check which files were deleted after the actual deletion.
(Therefore, you should use the command carefully.)

/ You must have administrator (root) privileges to manipulate (=edit including deletion) the directory group directly below.
Unless you run the rm command with administrator privileges, you may have deleted the following personal files with user privileges: /home/<USER> or files created under /tmp/.
Other than these, as you see errors such as Permission denied, they should have been played with permissions and not deleted.

As far as I've tried with "Simple Sample Environment = Just put multiple files under a single directory", if multiple files are to be manipulated, they appear to be processed in approximate file name dictionary order (a-z).
However, there is no certainty as to what happens when the hierarchy processes a deep list.


2022-09-30 19:29

What on earth has disappeared (with attached image)

I believe that all files and directories that the user who executed has write permission have been deleted.However, if there are any files left in the directory, the directory has not been deleted.

Am I correct in understanding that the display of operation not permitted and permission denied was not erased?

That's right.


2022-09-30 19:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.