O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ln

Synopsis

ln [options] file1 file2
ln [options] files directory

Creates pseudonyms (links) for files, allowing them to be accessed by different names. In the Finder, links appear and work as aliases. In the first form, link file1 to file2, where file2 is usually a new filename. If file2 is an existing file, it is removed first; if file2 is an existing directory, a link named file1 is created in that directory. In the second form, create links in directory, each link having the same name as the file specified.

Options

-f

Force the link to occur (don't prompt for overwrite permission).

-i

Interactive mode. Asks for permission to overwrite if the target file exists. This is the default.

-n, -h

Don't overwrite existing files.

-s

Create a symbolic link. This lets you link across filesystems and also see the name of the link when you run ls -l. (Otherwise, you have to use find -inum to find any other names a file is linked to.)

-v

Verbose mode. Show each file as it gets processed.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required