ln(1) DG/UX R4.11MU05 ln(1)
NAME
ln - link files
SYNOPSIS
ln [ -f ] [ -n ] [ -s ] file1 [ file2... ] target
DESCRIPTION
The ln command links filen to target by creating a directory entry
that refers to target. By using ln with one or more file names, the
user may create one or more links to target.
The ln command may be used to create both hard links and symbolic
links; by default it creates hard links. A hard link to a file is
indistinguishable from the original directory entry. Any changes to
a file are effective independent of the name used to reference the
file. Hard links may not span file systems and may not refer to
directories. The ln command cannot be used to create a hard link to
a file that is in a control point directory.
Without the -s option, ln is used to create hard links. filen is
linked to target. If target is a directory, another file named filen
is created in target and linked to the original filen. If target is
a file, its contents are overwritten.
If ln determines that the mode of target forbids writing and the
process has MAC write access to target, it will print the mode (see
chmod(2)), ask for a response, and read the standard input for one
line. If the line begins with y, the link occurs, if permissible;
otherwise, the command exits.
The following options are recognized:
-f ln will link files without questioning the user, even if the
mode of target forbids writing. Note that this is the default
if the standard input is not a terminal,
-n If the linkname is an existing file, do not overwrite the
contents of the file. The -f option overrides this option.
-s ln will create a symbolic link. A symbolic link contains the
name of the file to which it is linked. Symbolic links may span
file systems and may refer to directories.
If the -s option is used with two arguments, target may be an
existing directory or a non-existent file. If target already exists
and is not a directory, an error is returned. filen may be any path
name and need not exist. If it exists, it may be a file or directory
and may reside on a different file system from target. If target is
an existing directory, a file is created in directory target whose
name is filen or the last component of filen. This file is a
symbolic link that references filen. If target does not exist, a
file with name target is created and it is a symbolic link that
references filen.
If the -s option is used with more than two arguments, target must be
an existing directory or an error will be returned. For each filen,
a file is created in target whose name is filen or its last
component; each new filen is a symbolic link to the original filen.
The files and target may reside on different file systems.
On a system with DG/UX information security, the process must have
MAC write access to both the target and filen when creating a hard
link. When creating a symbolic link, the process must have MAC write
access to target if it exists, or to the directory containing target
if target does not exist.
The MAC attributes of a symbolic link are irrelevant, since all
access checks are made using the security attributes of the directory
that the symbolic link referrences.
SEE ALSO
chmod(1), cp(1), mv(1), rm(1), link(2), readlink(2), stat(2),
symlink(2).
Licensed material--property of copyright holder(s)