Equivalent for Windows 7 "mklink" on OS X?

2

Is there a feature on OS X that does the same as mklink under Windows 7? It can create symbolic links and hard links.

I have just read about this tool to have Dropbox sync an application folder by combining it with mklink on Windows 7, using a hard link:

http://www.hackingfreaks.in/2011/01/9-amazing-software-mashups-killer-free.html

How can I achieve this on OS X?

Cilvic

Posted 2011-01-11T16:34:57.003

Reputation: 569

Answers

4

Open /Applications/Utilities/Terminal.app. Run ln for a short description and man ln for the documentation.

Example:

ln existing.txt new.txt

For folders, create a symbolic link using ln -s:

ln -s existing new

As per Scott's comment, these symbolic links work with Dropbox on OS X


Hardlinks on folders are possible but difficult, and insanely dangerous if you mess it up (they don't like recursion).

Daniel Beck

Posted 2011-01-11T16:34:57.003

Reputation: 98 421

2

Use a symlink to sync folders outside your Dropbox on Mac OS X (and Linux for that matter). It works fine, and you avoid the whole can of worms that hard linking directories is. See http://wiki.dropbox.com/TipsAndTricks/SyncOtherFolders

– Scott – 2011-01-11T16:59:14.960

0

Not so Equivalent like mklink.

ls -s /tmp/a /tmp/b

If I open project using CLion and select /tmp/b, I'll see it finally recognized as /tmp/a. The title bar of the window displays the path it "think".

While under windows, mklink /j c:\b c:\a will indeed make all applications think files in 'c:\b' not 'c:\a'.

Use CLion do the same thing: Open project in c:\b, the title bar will display "c:\b...".

This is the desired behavior a symbol link should be.

However, macOS cannot do this correctly.

user3849428

Posted 2011-01-11T16:34:57.003

Reputation: 1