I must have run an "rm -rf *" command in my root file system (noob mistake I know) as all my files and apps on my mac were deleted, but the computer was still functioning. I've continued working on the mac, and noticed there is no /System/ folder, so I'm thinking maybe I deleted the system folder. Is there a way to restore the file system but keep the apps and files I'm working with?
Restore Mac Without Deleting Files on macOS High Sierra
high sierramacos
Related Question
- MacOS Backup – How to Restore a Deleted System File on Mac
- MacOS – Deleted hidden files and now Mac won’t boot, how to fix this
- MacOS – Recover certain files from Time machine from previous Mac
- MacOS – Clean install Mac, restore backup without command line tools
- Terminal – Strange Files Named “/xEy4O” Keep Appearing
- MacOS – “All My Files” Folder was Emptied when I Deleted Content of the Downloads Folder
- Data Recovery – How to Recover Files Emptied from Trash on macOS
- MacOS – How to Determine Which App is Opening Too Many Files
Best Answer
You can boot into macOS Recovery by pressing Cmd-R at startup, from there you can reinstall macOS. This should leave your files intact, it's nevertheless not a bad idea to do a backkup first.
Apple has described the procedure in detail in https://support.apple.com/en-us/HT201314 and https://support.apple.com/kb/HT204904.