A link is a way reference a file from more than one place. You may have software that makes assumptions about where a file lives in the filesystem, but it might be more convenient for that file to actually live elsewhere, perhaps on another file system. You may also have a large file, say a video tutorial, appear in each user’s home directory on a multi-user machine, but you do not want the disk space consumed for multiple copies.

Unix has two kinds of links: hard links and symbolic links. OS X also brings aliases to the table.

Hard links

As mentioned earlier in the brief overview of the file system, hard links are entries in multiple directories that all refer to the same inode. The file appears in multiple places at once. Use the ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.