Apple - Mac OS X - How to Symlink /home to /Users

sudo ln -s /Users /home will work with additional configuration, but I don't think that is a good idea as you should access home via ~ in shell or $HOME. Also /home might be a Linux standard and often used in Unix but not always so better to rely on information that is guaranteed to work not something that works only most of the time if everyone has kept to a convention.

To make sudo ln -s /Users /home work, follow these steps (from the comments):

EDITOR=nano sudo -e /etc/auto_master
# add a "#" at the start of the line beginning with /home
# save changes
sudo automount -cv
sudo ln -s /Users /home

I regret this answer is not exactly authoritative, since I've never actually done this myself--though I have used a similar automounter on other Unix systems--but here's my understanding as to what /home is used for on OS X.

So, let's follow the trail:

If you first type mount in Terminal to show active mounts, you'll see this line:

map auto_home on /home (autofs, automounted, nobrowse)

autofs maps are defined in /etc/auto_master, and /home is in turn defined specifically in /etc/auto_home. If you take a look at /etc/auto_home, you'll see this line:

+/usr/libexec/od_user_homes

Follow the trail one more step to the od_user_homes man page, and you'll find a program whose purpose is to take a username, look it up in Open Directory, and return a URL to that user's home directory. If you read up on auto_master at its man page, you'll find that using an executable program for a map results in that program being called to look up a URL to mount, which is in turn mounted in-place.

The intended application appears to be that, if your Mac is connected to a directory service, going to /home/jdoe will cause the automounter to mount jdoe's home directory there.

Based on this, it seems logical to conclude that if you don't intend to connect your Mac to a directory service, you're probably okay removing the /home auto-mount as detailed in this comment. I don't know how future OS updates will deal with this, though.


There's no use for /home. OS X, like various other Unix versions, has a unique location for the user. In Linux it's at /home/user, and in OS X it's at /Users. This is why it is good practice to use the shorthand "~" or the environment variable $HOME.

While you can create a symlink to the user's base/home directory /Users/[username] using the following command:

ln -s ~ /foo

It will not work to create a link named /home as there is already a(n unused) directory with that name at the root of the system.

Tags:

Unix

Symlink