Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (k - l) ln(1)
The value specied for target_le is resolved using normal pathname resolution
rules. target_le le must be in the same OSS leset as source_le if you are
trying to create a hard link. If resolution of the pathname for target_le includes
symbolic links, all of the directories traversed must be in the same OSS leset as
source_le; otherwise, a hard link cannot be created.
target_directory
Species the relative or absolute lename of a directory in which links for the
specied source_le values should be created. target_directory must be in the
same OSS leset as source_le if you are trying to create hard links.
The value specied for target_directory is resolved using normal pathname reso-
lution rules. If resolution includes symbolic links, all of the directories traversed
must be in the same OSS leset as source_le; otherwise, a hard link cannot be
created.
EXAMPLES
1. To create a hard link to a le, enter:
ln chap1 intro
This links le chap1 to the new lename intro,ifintro does not already exist.
2. To create the link in Example 1 if intro already exists, enter:
ln -f chap1 intro
Now chap1 and intro are two lenames that refer to the same le. Any changes made to
one also appear in the other. If one name is deleted with the rm command, the le is not
actually deleted but remains under the other name.
3. To create a hard link for the le named index to the same name in another directory that
has the lename manual,enter:
ln index manual
This links le index to the new name manual/index.
Note that intro in Example 1 is the name of a le; manual in Example 2 is a directory
that already exists.
4. To create hard links for several les to names in another directory in the same OSS
leset, enter:
ln chap2 jim/chap3 /u/manual
This links le chap2 to the new name /u/manual/chap2 and le jim/chap3 to
/u/manual/chap3.
5. To use the ln command with pattern-matching characters, enter:
ln manual/* .
This links all les in the directory manual into the current directory (.), giving them the
same names they have in manual. Note that you must type a space between the * (aster-
isk) and the . (dot).
527188-007 Hewlett-Packard Company 561