MacOS – How to view Root directory and subdirectories in Finder

finderfoldersmacosroot

Apparently, the Macintosh HD icon on the desktop points to the root directory but it is not showing all the contents.

Some of the files and directories are the same as those which I see when I perform an ls on / dir in Terminal, but most other directories like /usr, /bin, etc are not visible.

I'm assuming that for security, Mac OS X isn't showing the rest of the files and directories. Is there a way to change this behavior so as to make it like we view root folder in Linux?

Edit:
just found the following here:

The Finder and the Terminal show different contents for the root
directory. Some items in the root directory are not visible in the
Finder. This reduces visual clutter and enhances simplicity. If you
are familiar with a UNIX-style command line you can use Terminal to
view all items in a directory.

As per this note, Terminal has to be used to view all the items. So, what do others do? Use terminal or there is some other way?

Best Answer

Enter in Terminal:

sudo chflags nohidden directoryname

Whereby directory name is the name of the directory that you want to see in Finder.

Reverse this by typing:

sudo chflags hidden directoryname

The Macintosh HD basically resembles the root directory. If you want it to appear on the desktop and in finder change this in the finder preferences.


Showing all files in Finder

Type in the terminal

defaults write com.apple.finder AppleShowAllFiles TRUE

Then log out and back in.