[prev] 30 [next]

Hard and Soft Links

File system links allow multiple paths to access the same data

Hard links

  • multiple directory entries referencing the same inode
  • the two entries must be on the same filesystem
  • Eg. Assuming 'fileA' already exists, ln fileA fileB would create a hard link named 'fileB'
Symbolic links (symlinks)
  • a file containing the path name of another file
  • opening the symlink opens the file being referenced
  • Eg. Assuming 'fileA' already exists, ln -s fileA fileC would create a symbolic link named 'fileC'
Example:

-rw-r----- 2 cs1521 46 Sep 10 22:28 fileA
-rw-r----- 2 cs1521 46 Sep 10 22:28 fileB
lrwxrwxrwx 1 cs1521  5 Sep 10 22:29 fileC -> fileA