Hard Link vs. Symbolic Link. Have you ever heard some of these… | by HUMBERTO TEJADA ESPINOZA | Oct, 2021

Shared By



Visit The Original Post

HUMBERTO TEJADA ESPINOZA

Have you ever heard some of these words? Are you curious to know what they are? What are they used for? Why are they important? Well, here we will explain it to you in the most simple and summarized way possible, so … LET’S GO!

Image from scriptcrunch
Image from codigofacilito

Generally speaking, an Inode contains the metadata of a file, this metadata includes information such as size, permissions, creation date, owner, and more. When a user tries to access a file or directory, the Inode table retrieves the file using its Inode identification, this is unique for each file or directory. For this reason, when these are created, they are associated with a unique INODE ID for each one. Normally the files have different INODE IDs, but there are ways for two files to share the same Inode and one of them is through HARD LINKS.

A HARD LINK is an exact copy of a file, however, it is not a reference to the file as such, but a reference to its INODE, that is, a HARD LINK what it does is point the folder or file directly to the INODE of the database. This means that even if you delete or modify the file or directory to which you had linked, the link will continue to work since it points directly to the data, it would be like having the files twice but occupying space only once, and without worrying that one of the two links disappears while the other remains. HARD LINKS share the same INODE, no matter how many HARD LINKS you create from the same file, they will all share the same INODE.

Leave a Reply

Your email address will not be published. Required fields are marked *