This article explains how to create, manage, and understand hard links in Linux file systems.
Learn how Linux file systems use hard links to let multiple directory entries point to the same underlying data. You’ll see how to create, inspect, and remove hard links without wasting disk space.
Every file on a Linux filesystem (ext4, XFS, etc.) is represented by an inode. The inode stores metadata—permissions, timestamps, and pointers to data blocks on disk. The “Links” count in the stat output shows how many directory entries (hard links) reference that inode.Let’s simulate Aaron saving a photo of his dog:
Copy
Ask AI
mkdir -p /home/aaron/Picturesecho "Picture of Milo the dog" > /home/aaron/Pictures/family_dog.jpgstat /home/aaron/Pictures/family_dog.jpg