What’s the difference between ln -s and alias?

An Alias is a Macintosh Finder concept. When you make an Alias in the Finder, the Finder tracks it. When you move the original file or folder, the alias follows it.

A symbolic link is a Unix File System concept. When you make a symbolic link, it merely points to the original location. Move the original, and the symbolic link will point nowhere.

When you use a Mac application, and use the Open/Save dialog box, it will handle aliases because it uses the Finder API, and the Finder handles alias tracking.

Unix tools don’t integrate with the Finder API, so can’t track aliases. However, they work with the underlying Unix API which handles symbolic links. You can use ls on a symbolic link because it uses the Unix API. Same with Python.

Back in the System 7/8/9 days, the file system couldn’t handle symbolic links much like the Windows API uses shortcuts and not symbolic links. You needed aliases.

However, Mac OS X is a Unix based OS, so understands the concept of symbolic links. The Finder now treats symbolic links as it did aliases (except that symbolic links don’t update when the original moves). The only reason for aliases is to be compatible with the old Finder file system.

Leave a Comment