All pastes #392492 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-03-12 21:43 UTC
rendered paste body
DESCRIPTION
       There are two concepts of `link' in Unix, usually called hard link  and
       soft link. A hard link is just a name for a file.  (And a file can have
       several names. It is deleted from disk  only  when  the  last  name  is
       removed. The number of names is given by ls(1).  There is no such thing
       as an `original' name: all names have the same status. Usually, but not
       necessarily,  all names of a file are found in the filesystem that also
       contains its data.)

       A soft link (or symbolic link, or symlink)  is  an  entirely  different
       animal:  it  is  a  small special file that contains a pathname.  Thus,
       soft links can point at files on different  filesystems  (possibly  NFS
       mounted from different machines), and need not point to actually exist-
       ing files.  When accessed (with the open(2) or stat(2) system calls), a
       reference  to a symlink is replaced by the operating system kernel with
       a reference to the file named by the pathname.   (However,  with  rm(1)
       and  unlink(2)  the  link itself is removed, not the file it points to.
       There are special system calls lstat(2) and readlink(2) that  read  the
       status  of  a symlink and the filename it points to.  For various other
       system calls there is some uncertainty and variation between  operating
       systems  as  to whether the operation acts on the symlink itself, or on
       the file pointed to.)