What Is Difference Between Softlink and Hardlink in Linux?

What Is Difference Between Softlink and Hardlink in Linux?
Contents

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. … 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.

A hard link is essentially a label or name assigned to a file. … This new link is not a separate copy of the old file, but rather a different name for exactly the same file contents as the old file. Consequently, any changes you make to oldfile will be visible in newlink .

Hard links more flexible and remain linked even if the original or linked files are moved throughout the file system, although hard links are unable to cross different file systems. ls -l command shows all the links with the link column shows number of links.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.