Creating directory hard links in Mac OS X

Felix Geisendörfer picture Felix Geisendörfer · Sep 16, 2009 · Viewed 62.8k times · Source

How can I create a hard link to a directory in Mac OS X?

This feature has been added to their file system in Mac OS X v10.5 (Leopard) (for time machine), but I could not find any information on actually using it from the command line.

Answer

Sam picture Sam · Feb 25, 2011

I have bundled up the suggested answer in a Git repository if anybody is interested: https://github.com/selkhateeb/hardlink

Once installed, create a hard link with:

hln source destination

I also noticed that unlink command does not work on Mac OS X v10.6 (Snow Leopard), so I added an option to unlink:

hln -u destination

To install Hardlink, use Homebrew and run:

brew install hardlink-osx