OS X spawns from two different cultures: Unix/POSIX and Mac OS.
Folders like /usr
, /var
, /etc
, the command line shell in the Terminal (bash
by default) all belong to POSIX environment. Portable software targeting Unix-based systems (like git
) go into /usr/local
by default, or into package manager's defined location if installed by it (Homebrew uses /usr/local
, MacPorts use /opt/local
).
Library
, Applications
, /System
and others belong to Mac OS specifically. Apple's software, services, and GUIs of third-party apps go there.
The ~
symbol in path is a traditional way to denote path to current user's home folder. Things that must not be seen by other user accounts go into ~/...
counterpart. For example, Mail keeps emails in ~/Library
, but standard stationery templates in /Library
.
Library
folders are supposed to be accessed by applications programmatically, not browsed by user via Finder. Since 10.9, ~/Library
is hidden so that users won't unknowingly screw anything there.
There are no out-of-the-box recommendations how to store your files. They will be as good organized as you are good in organizing. They only thing to say in context of OS X is that your files must be in the home folder, but not in ~/Library
, and probably not in ~/Public
which exists to share files with others.
Best Answer
Depending on who is calculating directory sizes, hard-linked files can easily get counted twice, even though they are really only a single inode and should be counted only once.
The
du
terminal command is the surest way to find out how much space a directory is really taking. It never counts hard-linked files more than once.(Caveat. If a file in directory A is hard-linked to a file in directory B, and neither directory is contained in the other,
du A
anddu B
will each count the file once, so you cannot just add the reported sizes together and get a meaningful sum. However,du C
, where C is a directory that contains both A and B, will count the file only once, arbitrarily deciding whether to count the storage as part of A or as part of B.)