Working with Linux File Links

315

In this article by Oliver Pelz, the author of Fundamentals of Linux, you’ll take a look at what Linux file links are and how to work with them.

Connecting a filename to the actual data is managed by the filesystem using a table or data structure, which is called a title allocation table. In the Linux filesystem, an Inode is the actual entry point to a specific file’s data on the hard disk. To simplify, you can just consider that the Inode represents the actual data of a file. The filesystem management now ensures that every normal file, upon creation, has one link entry in its allocation table to connect the actual filename to the Inode on the hard disk. Such a link is also called a hard link. The original filename to the Inode relationship is also linked using a hard link. Now, the cool thing about the Linux filesystem is that you can create additional hard links to an existing Inode, which is like having alternative names for a file.

One of the drawbacks of a hard link is that you cannot differentiate a hard link from the original filename or the Inode. This can cause problems and side effects because if you change the original file’s content, the hard link’s content will be changed as well. 

Read more at LinuxTechLab