Are there any differences between `/etc` and `/private/etc`?

35

4

Are there any differences between /etc and /private/etc on Mac OS X?

gilsilas

Posted 2011-04-14T10:37:46.017

Reputation: 453

15FYI, in Mac OS, /etc links to /private/etc. – Felix – 2011-04-14T10:39:52.380

tnx, what's about /usr ? shouldn't it link to /Users/myUser ? – None – 2011-04-14T10:43:22.207

1

@gilsilas: I suggest you have a look at http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

– Felix – 2011-04-14T10:47:41.580

1

FileSystem Hierarchy Standard is just for Linux and not for Unix - for OSX see http://en.wikipedia.org/wiki/Hierarchical_File_System for the disk structure and http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html for the directories

– user151019 – 2011-04-14T12:26:03.600

@gilsias Regarding @Felix's answer: No! /usr is not where user home folders are located in (most) Linux distros! – msanford – 2011-04-14T23:37:38.653

Answers

31

On i386/darwin10.0/10.7.0:

%  ls -aFGl / | grep private
lrwxr-xr-x@   1 root  wheel        11 Apr 28  2010 etc@ -> private/etc
drwxr-xr-x@   6 root  wheel       204 Apr 28  2010 private/
lrwxr-xr-x@   1 root  wheel        11 Apr 28  2010 tmp@ -> private/tmp
lrwxr-xr-x@   1 root  wheel        11 Apr 28  2010 var@ -> private/var

%  ls -aFGl /private
total 0
drwxr-xr-x@  6 root  wheel   204 Apr 28  2010 ./
drwxrwxr-t  32 root  admin  1156 Jan 19 10:04 ../
drwxr-xr-x  95 root  wheel  3230 Apr  7 07:06 etc/
drwxr-xr-x   2 root  wheel    68 Jan 27  2010 tftpboot/
drwxrwxrwt   9 root  wheel   306 Apr 15 09:03 tmp/
drwxr-xr-x  26 root  wheel   884 Apr 28  2010 var/

So /etc is a symlink. To /private/etc, which is a directory. They both have the same contents. The same is true for /tmp and /var.

Johnsyweb

Posted 2011-04-14T10:37:46.017

Reputation: 2 324

The same with /var and /tmp. – Daniel Beck – 2011-04-14T11:30:26.747

1Regarding your command, I'm curious, what's your alias/function ls definition? – Daniel Beck – 2011-04-14T11:34:34.077