File Management «Prev 

Hard links versus symbolic links in Unix



Inodes are associated with precisely one directory entry at a time. However, with hard links it is possible to associate multiple directory entries with a single inode. To create a hard link use ln command as follows:
The commands below create a link to file1.
# ln /root/file1 /root/file2
# ls -l

Hard link vs. Soft link in Linux or UNIX

Characteristics of Hard Links

  1. Hard links cannot link directories.
  2. Cannot cross file system boundaries.
  3. Soft or symbolic links are just like hard links.
  4. It allows you to associate multiple filenames with a single file.
  5. Hard links always refer to the source, even if moved or removed.
However, symbolic links allow:
  1. To create links between directories.
  2. Can cross file system boundaries.
  3. These links behave differently when the source of the link is moved or removed.
  4. Symbolic links are not updated.