Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

ln(1) OSS Shell and Utilities Reference Manual
NAME
ln - Links les
SYNOPSIS
ln [ -f ][-s ] source_le target_le
ln [ -f ][-s ] source_le [ ... ] target_directory
FLAGS
-f Forces removal of existing target pathnames to allow specied links.
-s Creates symbolic links.
DESCRIPTION
The ln command links a single le source_le to le target_le or links one or more les to the
same lenames in another existing directory (target_directory). If more than two arguments are
specied and the nal argument is not a directory, an error results.
By default, ln makes hard links. A hard link can only be created when all of the following are in
the same OSS leset:
source_le
target_le or target_directory
All directories used for pathname resolution of any of the above
When the -s ag is used, ln makes symbolic links. A symbolic link can be created when
source_le and target_le or target_directory are in different OSS lesets.
If either of the following is true and the -f ag is not specied:
target_le exists
target_directory contains a le with the same name as a source_le specication
the ln command writes a diagnostic message to the standard error le, does nothing further with
the current source le, and goes on to any remaining source les.
Operands
source_file Species the absolute or relative pathname of the le to which the link should be
made.
The le is found through normal pathname resolution rules. When a component
of the pathname refers to a symbolic link rather than a directory, the pathname
contained in the symbolic link is resolved. If the pathname in the symbolic link
starts with a slash (/) character, the symbolic link pathname is resolved relative
to the root directory of the process. If the pathname in the symbolic link does
not start with a slash (/) character, the symbolic link pathname is resolved rela-
tive to the directory that contains the symbolic link.
If the le is not in the same OSS leset as target_le or target_directory, a hard
link cannot be created. If resolution of the pathname for source_le includes
symbolic links, all of the directories traversed must be in the same OSS leset as
target_le or target_directory; otherwise, a hard link cannot be created.
target_file Species the relative or absolute pathname to assign to the link.
The resolved pathname for a hard link stores the inode information necessary to
provide access to source_le only within the same OSS leset. The resolved
pathname for a symbolic link stores the lename for later resolution, regardless
of whether source_le is in the same OSS leset.
560 Hewlett-Packard Company 527188-004