In Linux, a file is represented by an inode, which stores metadata about the data block. Hard links connect filenames to inodes, allowing multiple filenames to refer to the same file. Deleting a hard link removes that specific filename's connection to the inode but leaves other hard links intact. Soft links, on the other hand, point a link file to a target filename rather than an inode. When all hard links to an inode are removed, the inode is marked for deletion. Soft links can become dead links if the target file is moved or deleted, retaining a pointer to a non-existing file.

7m read timeFrom bhoot.dev
Post cover image
Table of contents
What makes a file in Linux?Hard linksSoft linksIn closing

Sort: