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

 

<< PreviousWord BrowserNext >>
claude mckay
phelsuma
zhiyi
john walker (programmer)
fijian
warhammer fantasy
lol
music of massachusetts
total annihilation
cavedog entertainment
trinity anglican school
equine forelimb anatomy
logitech
33 (number)
78 (number)
music of new york
45 (number)
sydney boys high school
the journeyman project
board of studies, new south wales
higher school certificate
hsc
zhao gao
desiro
reel to reel audio tape recording
oceanic dolphin
pro tv
televiziunea romana
romanian television
mineral (band)
old frisian
tursib
antena 1
the dillinger escape plan
edith cresson
body water
cryptopsy
arthur wakefield
flicker
kissinger and associates
wilfred thesiger
afrosoricida
steve wynn
garden lupin