.TH ln "" "" Command
.PC "Create a link to a file"
\fBln [\-f] \fIoldfile\fB \fInewfile\fR
.br
\fBln [\-f] \fIoldfile ... directory\fR
.PP
.HS
.SH Option:
.IC \fB\-f\fR
Force link even if \fInewfile\fR exists
.HE
The \*(CO system knows a file by its i-node number.
Each file is also \fIlinked\fR to one or more file names, each name being
stored in a directory.
This system means that the same file can be known by multiple names in
multiple directories.
The command
.B ln
lets you create a new link to a file.
.PP
In its first form,
.B ln
links the name
.I newfile
to the file that is already named
.IR oldfile ,
provided that
.I newfile
does not already exist.
.\"If
.\".I newfile
.\"is omitted, a link is created in the current directory
.\"with the same file name as
.\".IR oldfile ,
.\"with leading directory information removed.
.PP
In the second form,
.B ln
links
.I oldfile
with an identical name in another
.IR directory .
In effect, one file will ``live'' in two directories.
.PP
If
.I newfile
already exists,
.B \-f
forces
.B ln
to unlink it and assign its name to
.IR oldfile .
.SH "See Also"
.Xr "commands," commands
.Xr "cp," cp
.Xr "ls," ls
.Xr "mv," mv
.Xr "rm" rm
.SH Notes
Links across file systems are impossible.
For example, if your \*(CO system has two file systems, one mounted on
.B /f
and the other mounted on \fB/usr\fR, you cannot use
.B ln
to link a file in
.B /v
to one in
.BR /usr .
.PP
Note, too, that
.B ln
lets you link a directory to another file.
This feature is permitted by \*(PX; however, because \*(CO
does not yet support symbolic links, this feature at best is useless,
and at worst is rather dangerous.
.I "Caveat utilitor."
