Every file on a Linux filesystem is represented by an inode, which stores metadata (permissions, timestamps, disk block locations). A hard link is simply another directory entry that points to the same inode.Consider Aaron’s photo of his dog Milo, saved as:
Copy
Ask AI
/home/aaron/Pictures/family_dog.jpg
Create this sample file and inspect its inode:
Copy
Ask AI
# Create the fileecho "Picture of Milo the dog" > ~/Pictures/family_dog.jpg# Show metadata, including inode and link countstat ~/Pictures/family_dog.jpg
Unique number with file metadata & data-block pointers
Links
Count of directory entries referencing this inode (starts at 1 for a new file)
Data
Actual content blocks on disk
When you open or read a file, the kernel looks up its name, retrieves the inode (e.g., 52946177), and accesses the data blocks. Hard links simply give you multiple names for the same inode.