Sample Header Ad - 728x90

In general, which files and directories can be deleted from MacOS without bricking it?

-3 votes
2 answers
189 views
I would like to make my MacOS as minimal as possible without it being unable to boot. The main reason is to reduce complexity and focus on understanding a smaller number of things before adding in more functionalities. In case someone were to say, "That isn't a good way to learn," I would say, that's your opinion, but I would like to know out of curiosity's sake which files I can delete, and which I should not. I am pretty sure there are three permissions groups on Mac - staff, wheel, and admin, which is what you see when you do ls -l - drwxrwxrwx has three repetitions of "rwx", one for each group. I think "sudo" causes you to enter into the second-highest permissions level, but as I tried to delete some system files with sudo, I still got the message "operation not permitted" sometimes. Is there any command to delete those even more restricted files, or is it not a function in MacOS? What is a general explanation for which files/directories can be deleted, and which can't? I think there are some .plist files you can delete, but what I found so far is that when you reboot, the OS realizes something is wrong and goes into recovery mode, where I am pretty sure it regenerates a lot of the files it needs (I think I had this happen for a Bluetooth settings .plist file, for example). But I am sure there are some files that comes with MacOS by default that are not needed, for example, I think I was able to get rid of the Movies and Music directories, and some system files I can't remember, I think it might have had to do with Xcode though. So what can I delete without impeding or harming the system? I tried sudo rm -r * in the top level directory, because I was wondering if since sudo didn't have the absolute top-level permissions, it would not delete any truly system-critical files. So far that has appeared to be the case, as my Mac is functioning fine, but I have not rebooted yet to see what happens then. When I do sudo rm -r * in / or any directory, I get a message asking if I want to override that some file cannot be deleted. I do not see any message about what the expected responses are - "yes", "y"? Does pressing enter mean yes or no? If I hold the enter key down, there can be a huge number of such messages. Is there any way to force the override for the entire command so you do not have to manually answer "yes" to seemingly hundreds of such questions? I think some system administrators will say, "You don't want to do that, that's a bad idea," but the point is I want to know what I can do that avoids the potentially destructive outcome such people may be forewarning one about. Thank you.
Asked by Julius Hamilton (385 rep)
Jan 30, 2023, 07:38 PM
Last activity: Jan 30, 2023, 09:12 PM