OS X directory structure

Discussion in 'macOS' started by mak8, Dec 26, 2010.

  1. mak8 macrumors newbie

    Joined:
    Dec 26, 2010
    #1
    I am trying to get a better understanding of the os x system structure. Can someone explain to me what the hidden files/directories are in my / ?

    http://imgur.com/74Gk2

    I am familiar with linux as well, but os x does some very different things.

    Thanks in advance.
     
  2. xyzzy-xyzzy macrumors member

    Joined:
    Sep 19, 2010
    #2
    It's basically a unix under the hood. Maybe this will help you (although this is a little out of date):

    http://www.westwind.com/reference/OS-X/invisibles.html

    Google searches are helpful for this sort of thing ;)

    The Finder hides all files starting with '.' as well as other unix and os related directories simply to avoid confusion for the average user. A google search will lead you to sites which explain how to make all this stuff visible if you desire (e.g., try "hidden os x files directories" in google).
     
  3. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #3
    For starters, Mac OS X tosses all the UNIXy stuff in a folder called private. That isn't the normal way of doing things in UNIX though, so symbolic links to the usual folders on a Linux system (bin, sbin, usr, etc, var, etc.) live in the root of the drive, and point to the private folder... at least that's how stuff was structured prior to Leopard. I haven't poked around at the hidden parts of Mac OS X since then.
     
  4. Hal Itosis, Dec 27, 2010
    Last edited: Dec 27, 2010

    Hal Itosis macrumors 6502a

    Hal Itosis

    Joined:
    Feb 20, 2010
    #4
    Only /etc, /tmp and /var are abstracted to another location (via symlinks):
    Code:
    $ [COLOR="Blue"]ls -la / |grep ^l[/COLOR]
    lrwxr-xr-x@  1 root    wheel         11 Apr 17  2010 etc -> private/etc
    lrwxr-xr-x@  1 root    wheel         11 Apr 17  2010 tmp -> private/tmp
    lrwxr-xr-x@  1 root    wheel         11 Apr 17  2010 var -> private/var
    OS X has been that way all along (AFAIK).

    /bin, /sbin and /usr are at the root level (as is usual in Unix), but still aren't visible in Finder.



    That might take a lot of explaining, as there seems to be over 20 such items:
    Code:
    $ [COLOR="Blue"]ls -lAOog / |grep -E '(hidden| \.)'[/COLOR] 
    -rw-r--r--@  1   hidden    21508 Dec 24 14:34 .DS_Store
    drwx------   3   -           102 Apr 17  2010 .Spotlight-V100
    drwxrwxrwt@  3   hidden      102 May  6  2010 .TemporaryItems
    d-wx-wx-wt   2   -            68 Oct  1 01:52 .Trashes
    srwxrwxrwx   1   -             0 Dec 18 03:15 .dbfseventsd
    ----------   1   -             0 Feb 11  2010 .file
    drwx------  22   -           748 Dec 27 13:56 .fseventsd
    -rw-------   1   hidden   589824 Dec  8 23:56 .hotfiles.btree
    drwxr-xr-x@  2   hidden       68 May 18  2009 .vol
    drwxr-xr-x@  2   hidden       68 Feb 11  2010 Network
    drwxrwxrwt@  8   hidden      272 Dec 27 13:41 Volumes
    drwxr-xr-x@ 39   hidden     1326 Nov 11 08:14 bin
    drwxrwxr-t@  2   hidden       68 Feb 11  2010 cores
    dr-xr-xr-x   3   hidden     4219 Dec 27 12:16 dev
    lrwxr-xr-x@  1   hidden       11 Apr 17  2010 etc -> private/etc
    dr-xr-xr-x   2   hidden        1 Dec 27 12:16 home
    -rw-r--r--@  1   hidden 18693813 Nov  6 02:22 mach_kernel
    dr-xr-xr-x   2   hidden        1 Dec 27 12:16 net
    drwxr-xr-x@  6   hidden      204 Apr 17  2010 private
    drwxr-xr-x@ 67   hidden     2278 Nov 11 08:15 sbin
    lrwxr-xr-x@  1   hidden       11 Apr 17  2010 tmp -> private/tmp
    drwxr-xr-x@ 11   hidden      374 Jun 10  2010 usr
    lrwxr-xr-x@  1   hidden       11 Apr 17  2010 var -> private/var
    I'm not sure if "File System Overview" has any answers, but google could help with specific items perhaps.

    If a particular hidden item interests you, then mention its name... and maybe folks will be able to provide a more focused answer.

    PS: it's usually a lot easier (and more utilitarian) to just copy/paste right from Terminal to post listings, etc., as text (wrapped with [code] tags) rather than linking to screenshots in some image file format.

    --

    EDIT: this historical document (from 2000) has a bit of related info (and the rest is pretty interesting too): "The Challenges of Integrating the Unix and Mac OS Environments"
     

Share This Page