
ln | 249
Linux
Commands
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
ln
ln [options] sourcename [destname]
ln [options] sourcenames destdirectory
Create pseudonyms (links) for files, allowing them to be accessed
by different names. Links may be “hard” or “soft.” A hard link
creates two names for the same file, and a soft, or symbolic, link
creates a second file which acts as a shortcut to the first.
The first form links sourcename to destname, where destname is
usually either a new filename or (by default) a file in the current
directory with the same name as sourcename.Ifdestname is an
existing file, it is overwritten; if destname is an existing directory, a
link named sourcename is created in that directory. The second
form creates links in destdirectory, each link having the same name
as the file specified.
Options
-b, --backup[=control]
Back up any existing files. When using the long version of the
command, the optional control parameter controls the kind of
backup. When no control is specified, ln will attempt to read
the control value from the VERSION_CONTROL environ-
ment variable. Accepted values are:
none, off
Never make backups.
numbered, t
Make numbered backups.
existing, nil
Match existing backups, numbered or simple.
simple, never
Always make simple backups.
-d, -F, --directory
Allow hard links to directories. Available to privileged ...