X

OS X In Depth: Aliases vs. Symbolic links

OS X In Depth: Aliases vs. Symbolic links

CNET staff
3 min read
You wouldn't know it just by looking, but Mac OS X has two types of aliases. The first are the traditional aliases, which work the same way they do in Mac OS 9. The second type are called symbolic links and they are derived from UNIX. As explained in System Overview, there is a key difference in how they work. Aliases are linked to the file or folder they point to. This means that if you move the original file to a new location, the alias follows it and is still linked to it. Symbolic links refer to a specific pathway. Thus, a symbolic link to a file called Testing in your Documents folder will only work if the file remains in that folder location. Move it and the link is broken. On top of that, if you move the file and create a different one with the same name in the original location, the symbolic link will now point to that file (since it has the same pathway). Both methods have their advantages and disadvantages.

Symbolic links are common in the< various Library folders, inside application packages, and in the invisible UNIX/BSD directories. But they can also appear on the desktop as links to any ordinary file or folder.

As far as we can tell, there is no immediate way to distinguish a symbolic-linked file from an alias file. They both have the same icon (with the little arrow in the corner) and the Show Info window says <alias> in both cases. A quick test would be to move the original file temporarily to a new location; if that breaks the connection, it was a symbolic link.

    Update: Thomas Willing discovered that, when running Mac OS 9.1, Mac OS 9 aliases simply say "Alias" in the Get Info window, while symbolic links say "Mac OS X Alias."

You create aliases in Aqua via methods familiar to Mac OS 9 users. You can use Command-Option-drag, the Make Alias contextual menu command, or the Make Alias (Command-L) command in the Finder's File menu. Special note: If you try to move a file from a folder where you do not have permission to make changes, dragging the file will result in a copy being made at the new location rather than the file actually be moved. However, in some cases, as when you drag the icon of one partition over to another - or a disk image file to a folder on a hard drive - an alias is created rather than a copy being made.

As far as we can tell, there is no way to create a symbolic link in the Finder (although there may be a shareware utility that can do it). To create a symbolic link, you need to go to Terminal and type <ln - s (pathway of original file) (pathway of symbolic link)>. If the link does not appear on the desktop, search for it via Sherlock and then double-click on its name in the Search Results output. This will force it to show up.

Understanding this difference can help explain why some "alias" links break in situations where they would not break in OS 9. The reason is that the alias is really a symbolic link.

As a side note, it appears that Mac OS X dropped the Show Original command from the contextual menu.

See this MacFixIt Forums thread for some related material.