Link (Unix)
Encyclopedia
The link utility is a Unix
command line program that creates a hard link
from an existing directory entry to a new directory entry. It does no more than call the link system function. It does not perform error checking before attempting to create the link. It returns an exit status that indicates whether the link was created (0 if successful, >0 if an error occurred). Creating a link to a directory entry that is itself a directory requires elevated privileges.
The ln
command is more commonly used as it provides more features: it can create both hard links and symbolic link
s, and has error checking.
file1: The pathname of an existing file.
file2: The pathname of the new directory entry to be created.
Note that file1 must specify an existing file, and file2 must specify a nonexistent entry in an existing directory.
(SUS), specified in the Shell and Utilities volume of the IEEE 1003.1-2001 standard.
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
command line program that creates a hard link
Hard link
In computing, a hard link is a directory entry that associates a name with a file on a file system. . The term is used in file systems which allow multiple hard links to be created for the same file. This has the effect of creating multiple names for the same file, causing an aliasing effect: e.g...
from an existing directory entry to a new directory entry. It does no more than call the link system function. It does not perform error checking before attempting to create the link. It returns an exit status that indicates whether the link was created (0 if successful, >0 if an error occurred). Creating a link to a directory entry that is itself a directory requires elevated privileges.
The ln
Ln (Unix)
ln is a standard Unix command used to create links to files.- Link files :Links allow more than one file name to refer to the same file, elsewhere.There are two types of links, both of which are created by ln:...
command is more commonly used as it provides more features: it can create both hard links and symbolic link
Symbolic link
In computing, a symbolic link is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution. Symbolic links were already present by 1978 in mini-computer operating systems from DEC and Data...
s, and has error checking.
Synopsis
link file1 file2file1: The pathname of an existing file.
file2: The pathname of the new directory entry to be created.
Note that file1 must specify an existing file, and file2 must specify a nonexistent entry in an existing directory.
Standards
The link command is part of the Single UNIX SpecificationSingle UNIX Specification
The Single UNIX Specification is the collective name of a family of standards for computer operating systems to qualify for the name "Unix"...
(SUS), specified in the Shell and Utilities volume of the IEEE 1003.1-2001 standard.
External links
- IEEE Std 1003.1-2004 Shell & Utilities volume -- list of SUSSingle UNIX SpecificationThe Single UNIX Specification is the collective name of a family of standards for computer operating systems to qualify for the name "Unix"...
utilities. - GNU Coreutils link documentation.