Search code examples
macosrm

I typed sudo rm -rf ~/ by mistake on OSX


By mistake I types this and pressed enter. It was taking a strangely long time to delete the folder I initially wanted to delete.

I pressed ctrl + z when I say this message

xxxx$ sudo rm -rf ~/ /Users/xxx/Documents/workspace/my-folder rm: /Users/xxx//Library/Application Support: Directory not empty rm:

/Users/xxx//Library/WebKit: Directory not empty

Did vital stuff got deleted? IF I reboot the osx will it startup ? I already started saving my non git comited stuff


Solution

  • System-related files should be unaffected. However, there are a lot of important user-related files that may have been deleted before you suspended the command: applications in ~/Applications, preferences, documents, etc. I'd recommend restoring from backup once you've recovered any remaining files that have been created or modified since the last backup.