The link is a mechanism of creating a shortcut to the original file or directory which contains information about its files or directories.
There are two types of links :
- Soft Link or Symbolic links.
- Hard Links.
What is Soft link or Symbolic 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.
What is Hard link?
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)
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!!!