↑↓ move Enter open Esc close

Hard link

A second, equally real name for the same file.

A hard link is another directory entry pointing at an existing inode. Both names are equally "the real file": there is no original and no copy, and the data survives until every hard link is removed.

Because inode numbers are only meaningful within one filesystem, hard links cannot cross filesystems, and they cannot point at directories (that would let the tree contain cycles). ls -l shows the link count in its second column.

See it in practice

$ ln notes.txt second-name && ls -li notes.txt second-name

Same inode number, link count now 2. Delete either name and the data survives in the other.

Where you'll meet it

Learn these concepts by typing them: the interactive course builds them up lesson by lesson in a real simulated shell.