Date Archives August 25, 2016

Hard Link vs. Soft Link

linkbuilding

Hard Link

Hard links are just different names for the same file.

  • One file can have many different names or hard links.
  • Both original file and link file have same Inode number(Index Number).
  • If one is modified, the other one is also modified automatically.
  • Both files’ link number increases to 2.
  • Even though original is deleted, link file works properly.
  • Form: ln originalFile linkFile

Screen Shot 2016-08-24 at 10

Soft Link (Symbolic Link)

Soft links are similar to MS windows shortcut.

  • One file can have many shortcuts pointing to it.
  • Original file and link file have Different Inode number(Index Number).
  • If one is modified, the other one is also modified automatically.
  • Link number doesn’t change.
  • If original is deleted, link file doesn’t work.
  • Form: ln -s originalFile linkFile

Screen Shot 2016-08-24 at 11