HARD-LINK VS SOFT-LINK

The link is a mechanism of creating a shortcut to the original file or directory which contains information about its files or directories.

  1. Soft Link or Symbolic links.
  2. Hard Links.

A symbolic link, also known as symlink or soft link, is a special type of file that points to source file or directory in Linux. It is like a shortcut in Windows which contains the path of the original file and not the contents. In general, Symbolic links are used to link libraries and log files & folders on mounted NFS (Network File System) shares.

Hard link is a mirror copy of the original file. Deleting the original file will not impact anything, because the hard link file, will act as a mirror copy of the original file.

Difference between a hard-link and a symbolic-link (soft-link)

Difference between soft links and hard links in Linux

The difference between hard links and soft (or symbolic) links comes down to what they reference:

A symbolic or soft link is an actual link to the original file, whereas a hard link is a mirror copy of the original file. If you delete the original file, the soft link has no value, because it points to a non-existent file. But in the case of hard link, it is entirely opposite. Even if you delete the original file, the hard link will still has the data of the original file. Because hard link acts as a mirror copy of the original file.

Do share with others, if found useful!!!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store