MPE/iX Shell and Utilities Reference Manual, Vol 1

ln(1) MPE/iX Shell and Utilities ln(1)
NAME
ln — create a link to an existing file
SYNOPSIS
ln [–fiRrs] old new
ln [–fiRrs] old old ... dir
DESCRIPTION
Note: The MPE/iX implementation of this utility does not function exactly as this man page
describes. For details, see the MPE/iX NOTES section at the end of this man page.
ln creates a link to an existing file or set of files. A link is a new directory entry that refers to
the same file. This entry can be in the same directory that currently contains the file or in a
different directory. The result is that you get a new path name that refers to the file. You can
access the file under the old path name or the new one. Both path names are of equal impor-
tance. If you rm either name, the other one still remains and the file contents are still avail-
able under that name. The contents of the file do not disappear until you remove the last link.
A file may have any number of links to it. Thus you can establish any number of different
path names for any file.
In the first form given in the synopsis, new becomes a new path name for the existing file old.
In the second form, ln creates entries for all the old files under the directory dir. For example,
ln yourdir/* mydir
creates links under mydir to all the files under yourdir. The files have the same names
under mydir that they had under yourdir. ln always assumes this directory form when
the last operand on the command line is the name of a directory. In this case, none of the old
names may be a directory.
It is possible that there is already a file that has the same name as the link you are trying to set
up. We’ll refer to this file as the conflicting path name. To deal with a conflicting path name,
ln follows these steps.
If you have specified –i, ln writes a prompt to standard error to ask if you want to get rid
of the conflicting path name. If you answer affirmatively, ln attempts to remove it.
Otherwise, if you have specified –f, ln attempts to remove the conflict silently.
Otherwise, ln prints a diagnostic message.
ln gets to this point if it is going to get rid of the conflicting path name. It therefore
attempts to get rid of the conflicting path name in the same way that rm does. ln deletes
the file associated with the path name if this path name is the last link to the file. If ln
Commands and Utilities 1-293