Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ln(1) — SunOS 0.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rm(1)

cp(1)

mv(1)

link(2)

readlink(2)

stat(2)

symlink(2)

LN(1)  —  User’s Manual — Commands

NAME

ln − make links

SYNOPSIS

ln [ −f ] [ −s ] name1 [ name2 ]
ln name ... directory

DESCRIPTION

A link is a directory entry referring to a file or another directory; the same file or directory (together with its size, all its protection information, etc.) may have several links to it.  There are two kinds of links: hard links and symbolic links. 

Ln makes hard links by default.  A hard link to a file or directory is indistinguishable from the original directory entry; any changes to a file or directory are effective independent of the name used to reference the file or directory.  Hard links may not span file systems. 

Given one or two arguments, ln creates a link to an existing file or directory name1. If name2 is given, the link has that name; name2 may also be a directory in which to place the link; otherwise it is placed in the current directory.  If only the directory is specified, the link is made to the last component of name1.

Given more than two arguments, ln makes links to all the named files in the named directory.  The links made will have the same name as the files being linked to. 

OPTIONS

−f Force a hard link to a directory.  The −f option is only available to the super-user. 

−s Create symbolic links.  A symbolic link contains the name of the file or directory to which it is linked.  The referenced file or directory is used when an open(2) operation is performed on the link. A stat(2) on a symbolic link returns the linked-to file; an lstat(2) must be done to obtain information about the link.  The readlink(2) call may be used to read the contents of a symbolic link. Symbolic links may span file systems and may refer to directories.

SEE ALSO

rm(1), cp(1), mv(1), link(2), readlink(2), stat(2), symlink(2)

BUGS

Error messages print the wrong file name when the −s option is used. 

Sun System Release 0.3  —  31 March 1983

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026