ln(1)
NAME
ln − make a link
SYNTAX
ln [ -f ] [ -s ] name1 [ name2 ]
DESCRIPTION
The ln command creates a link to an existing file name1. If name2 is given, the link has that name. Otherwise it is placed in the current directory and its name is the last component of name1.
A link is a directory entry referring to a file. The same file, together with its size, all its protection information, and so forth, may have several links to it. There is no way to distinguish a link to a file from its original directory entry. Any changes in the file are effective independently of the name by which the file is known.
The -f option allows the superuser to link to a directory.
The -s option causes ln to create symbolic links. A symbolic link contains the name of the file to which it is linked. The referenced file is used when an open system call is performed on the link. A stat system call on a symbolic link will return the linked-to file. A lstat system call must be done to obtain information about the link. The readlink system 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
ls(1), mv(1), rm(1), link(2), readlink(2), stat(2), symlink(2)