1LN(1) General Commands Manual LN(1)
2
3
4
6 ln - make links
7
9 ln [ -s ] sourcename [ targetname ]
10 ln [ -s ] sourcename1 sourcename2 [ sourcename3 ... ] targetdirectory
11
13 A link is a directory entry referring to a file; the same file
14 (together with its size, all its protection information, etc.) may
15 have several links to it. There are two kinds of links: hard links and
16 symbolic links.
17
18 By default ln makes hard links. A hard link to a file is indistin‐
19 guishable from the original directory entry; any changes to a file are
20 effective independent of the name used to reference the file. Hard
21 links may not span file systems and may not refer to directories.
22
23 The -s option causes ln to create symbolic links. A symbolic link con‐
24 tains the name of the file to which it is linked. The referenced file
25 is used when an open(2) operation is performed on the link. A stat(2)
26 on a symbolic link will return the linked-to file; an lstat(2) must be
27 done to obtain information about the link. The readlink(2) call may be
28 used to read the contents of a symbolic link. Symbolic links may span
29 file systems and may refer to directories.
30
31 Given one or two arguments, ln creates a link to an existing file
32 sourcename. If targetname is given, the link has that name; targetname
33 may also be a directory in which to place the link; otherwise it is
34 placed in the current directory. If only the directory is specified,
35 the link will be made to the last component of sourcename.
36
37 Given more than two arguments, ln makes links in targetdirectory to all
38 the named source files. The links made will have the same name as the
39 files being linked to.
40
42 rm(1), cp(1), mv(1), link(2), readlink(2), stat(2), symlink(2)
43
44
45
464th Berkeley Distribution April 10, 1986 LN(1)