Linuxlab

Hard and symbolic links

Updated July 3, 2026

A hard link is another name for the same inode. A symbolic link is a separate file holding a path to the target.

ln  target link        # hard: the same inode
ln -s target link     # symbolic: a pointer to a path
stat -c '%h' target   # the hard link count

How it works: what survives a delete

Delete the original and a hard link keeps working, because the data lives until the link count reaches zero. A symbolic link dangles and points at a path that is no longer there. Also: hard links cannot cross filesystems, while symbolic links can and may point at a directory.

Used in

You need this in the lesson Inodes and links.