l

ln(1)

ln(1)

to ®le; an lstat() must be performed to obtain information about the link (see stat(2)). A readlink() call can be used to read the contents of the symbolic link (see readlink(2)). Symbolic links may span ®le systems and refer to directories.

Access Control Lists (ACLs)

If optional ACL entries are associated with new_®le, ln displays a plus sign (+) after the access mode when asking permission to overwrite the ®le.

If new_®le is a new ®le, it inherits the access control list of ®le1, altered to re¯ect any difference in ownership between the two ®les (see acl(5) and aclv(5)). In JFS ®le systems, new ®les created by ln do not inherit their parent directory's default ACL entries (if any), but instead retain their original ACLs.

EXTERNAL INFLUENCES

Environment Variables

LC_CTYPE determines the interpretation of text as single byte and/or multibyte characters.

LANG and LC_CTYPE determine the local language equivalent of y (for yes/no queries).

LANG determines the language in which messages are displayed.

If LC_CTYPE is not speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed or is set to the empty string, a default of C (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid setting, ln behaves as if all internationalization variables are set to C. See environ(5).

International Code Set Support

Single byte and multibyte character code sets are supported.

EXAMPLES

The following command creates file1 and file2 in dest_dir, which are linked back to the original ®les file1 and file2:

ln -f file1 file2 dest_dir

If file1 and/or file2 exists in the destination directory, it is removed and replaced by a link to file1 or file2, respectively. If existing ®le file1 or file2 is a link to another ®le or a ®le with links, the existing ®le remains. Only the link is broken and replaced by a new link to file1 or file2.

WARNINGS

ln does not create hard links across ®le systems.

DEPENDENCIES

NFS

Access control lists of networked ®les are summarized (as returned in st_mode by stat()), but not copied to the new ®le. When using ln on such ®les, a + is not printed after the mode value when asking for permission to overwrite a ®le.

AUTHOR

ln was developed by AT&T, the University of California, Berkeley and HP.

SEE ALSO

cp(1), cpio(1), mv(1), rm(1), link(1M), readlink(2), stat(2), symlink(2), symlink(4), acl(5), aclv(5).

STANDARDS CONFORMANCE

ln: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2

Section 1454

− 2 −

HP-UX Release 11i: December 2000