How do I access the /usr directory on macOS?

How can I access ALL of the directories in the terminal in macOS? (usr, etc, dev and so on) macOS is hiding them.

Is it possible to access them in the Terminal program on macOS, or does Apple not allow that? If so, do I need to use an aftermarket terminal program?

I can't find the answer to this by Googling it. I just called Apple technical support and they won't tell me how to do it. They said they don't want people messing around in their operating system. I will have to buy another computer eventually, but I just can't afford to right now. If someone would be kind enough to help me I would appreciate it.

5

1 Answer

macOS hides the operating system guts for roughly the same reasons that most buildings have their wiring and plumbing hidden (inside walls and floors): partly 'cause they look ugly, and partly so people won't mess with them and wind up electrocuted and/or with water spraying all over the room. You can certainly expose the OS files on macOS if you want to, but if you mess with them without knowing what you're doing, you're likely to break things. And frankly, if you have to ask this question, you really don't know what you're doing.

You want to mess around anyway? Ok, but start with the assumption that something terrible is going to happen as a result. Do you have any important files on the Mac? Then you'd better back them up somewhere else. One backup is good, two are better (especially if they're in different formats). Also, make an installer disk (follow the Apple instructions, or use DiskMaker X) so you can erase & reinstall the OS easily if it all goes sideways.

Now, how to get at the hidden files? There are several ways:

  1. Use the Terminal application provided with macOS, in the /Applications/Utilities folder. The standard unix commands show the hidden folders you mentioned, but by default they hide files and folders that start with ".". If you want to see those, use ls -a (the "-a" means "show [a]ll") or ls -A (which shows dotfiles except for "." and "..").
  2. You can use the Finder to navigate to hidden folders if you know their paths. Choose Go menu > Go to Folder (Command-Shift-G), enter the path you want to go to (e.g. "/etc"), and click Go.
  3. Starting in macOS Sierra (v10.12), you can press Command-Shift-Period in the Finder, and it'll toggle visibility of normally-hidden files and folders.

Note that none of these bypass file permissions restrictions. For that, you need something like sudo in Terminal, or any of the various operations that the Finder lets you do by entering your admin name & password. There are also some operations that System Integrity Protection forbids even with an admin override; you can disable this, but I don't recommend it.

9

You Might Also Like