|
|
Ln (Unix)The ln command is used on Unix-like systems to create links between files. Links allow more than one location to refer to the same information. There are two types of links; both are created by ln. - Symbolic links, which refer to a symbolic path indicating the abstract location of another file.
- Hard links, which refer to the specific location of physical data.
Usage The general syntax for the ln command is: ln -s target name The target parameter indicates the location or file to which the link will point. The optional name parameter specifies the name that link will be given. If no name is given, the basename of the target will be used. By default, ln creates a hard link. The -s option causes it to create a symbolic link. Usage examples ln abc xyz - Creates a hard link in the current directory.
- The link is named xyz.
- The target of the link is the same target as that of the file abc.
ln -s /usr/share/pixmaps/image.jpg - Creates a symbolic link in the current directory.
- The link is named image.jpg, because that is the basename of the target.
- The target of the link is the path /usr/share/pixmaps/image.jpg.
ln -s ../red.txt blue.txt - Creates a symbolic link in the current directory.
- The link is named blue.txt.
- The target of the links is the path ../red.txt.
See also
|
 |