Understanding Hidden Root Folders 5

Unix

Share
Understanding Hidden Root Folders

Hey

The Mac system, as you might well know is built on Unix. As a result there is a lot of Unix folders in the root system. This post is going to explain for people new the the Mac system a general understanding of what each folder does. This is designed to be a simple guide for new users, so experienced Unix and Mac developers probably know a lot more than me. You have to learn from somewhere.

The first step is to show theses hidden folders. You can use one of three ways. Secrets preference pane, where you show hidden files (the quickest). Quicklook, folder plugin where you can show hidden files in quicklook (safest). Or command line, in which you can actually see the folders. If you want to use the Terminal root to show the files type:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

To reverse the command type false instead of true.


My root folder will look very different to yours (probably). This is due to the installed programs and devices that I might have. But the main folders should be there.

.Trashes

A directory that stores the files that have been deleted but not permanently deleted. You have one of these folders in every folder that you delete a file from.

bin

Used to store binary files that you run from in Terminal and other applications. Contains programs such as rm (deleting stuff) and chmod (change file permissions) to name a few.

core

If a program has crashed and it dumps its memory into this folder. Only really used by developers.

dev

A place holder to keep track of various devices such as mice, keyboards etc.

etc

The configuration for storing all of the configurations for various programs. Will actually link to /private/etc. Stuff like apache web server config files are in here if you are running a webserver.

mach_kernal

The kernal files for running Mac operating system. The very core of the OS. If you fiddle with these files and you don’t no what you are doing you are in serious trouble.

private

Contains the actual folders for etc, tmp and var. Compared with aliases for the folders in root.

sbin

Again, contains more binaries this time for system administration and configuration.

tmp

Pretty much what it says on the tin. A place in which programs can store temporary files during installation. The actual location is /private/tmp.

usr

Another binary folder but this time it stores all of the binaries relating to user tasks. There are various folders which do ever so slight different tasks but it all relates to the user, compared to root and system config.

var

A place for storing configuration files and log files. Var/root is the home directory as the root user. Var/vm contains both your swap files and sleep image. The swap files is used when you are starting to run out of real memory. Mine is only at 64mb which isn’t to bad, probably why my computer is running fast today. If this file is very large, it might be time to invest in some more ram.

Volumes

Contains links to all of the mount points of volumes stored on your system.

Hopefully if you didn’t know before about root unix folders you should now. As stated before this is just a brief overview to give you an idea of how things work. As a final tip don’t both playing around with them unless you know what you are doing. A lot can go wrong in these folders. Thats probably why Apple hides them.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

5 Responses to “Understanding Hidden Root Folders”

  1. 1

    I think that should be “killall Finder” and about the var folder, it has nothing to do with speed or ram. My var folder is over 2GB and my MacBook (2.16 C2D) tops 180 on x-bench.

    Comment By Anonymous on May 20th, at 11:14 am

  2. 2

    The /var folder on unix systems are meant to be used for stuff like web sites, ftp root directories, caches, package management tool caches and stuff like that. It even may contain a physical swap file, but usually swap or page files is contained by it’s own partition placed close to the beginning of the disk, due to the disk rotation speed being faster closer to the center of the disk. RAM does not have any thing with that folder to do at all, would it not be quite incredible if you involved a disk to handle writes to ram and THAT actually made things faster? Have a nice weekend.

    Comment By Guldahl on January 23rd, at 4:40 pm

  3. 3

    yes but this is not the case in wintel systems, where his this PC guy is cominc from…a PC that teach to a Mac. Go figure…

    Comment By duhhhh on May 31st, at 10:13 am

  4. 4

    Hi, I used that terminal command. But then when I tried to reverse it with defaults write com.apple.finder AppleShowAllFiles FALSE, it didn’t work. Any ideas? Thanks.

    Comment By JesseT on October 21st, at 9:56 am

  5. 5

    @JesseT: Try this command instead:

    defaults write com.apple.finder AppleShowAllFiles -boolean NO

    :-)

    Comment By macgeeky on October 30th, at 6:20 pm