link oldfile newfile
link creates a hard link to an existing file. A link is a new directory entry that refers to the same file. This entry can be in the same directory that currently contains the file or in a different directory. The result is that you get a new path name that refers to the file. You can access the file under the old or new path name since both path names are of equal importance. If you use rm to remove one path name, the other remains and the file contents are still available under that name. The contents of the file do not disappear until the last remaining link associated with the file is removed.
Following the format, new becomes a new path name for the existing file old. If old names a symbolic link, link creates a hard link to the file that results from resolving the path name contained in the symbolic link.
Links are allowed to files only, not to directories. A file can have any number of links to it. Thus, you can establish any number of different path names for any file.
link is implemented as a shell built-in.
See Localization for more information.
link, ln, rm