Deleting the original file behind a symbolic link breaks that link (ls -l shows the path in red, broken), but deleting the original file behind a hard link changes nothing for that link: the content stays accessible, intact. This difference in behavior isn’t arbitrary, it follows directly from what each link type actually is.

What an inode actually represents

Every file on a Linux system is really an inode (the metadata and on-disk data location), plus one or more names in a directory that point to that inode. The name commonly used to refer to “the file” is just one directory entry among possibly several others, all pointing to the same underlying inode.

A hard link adds an extra directory entry pointing to exactly the same inode as the original, incrementing its reference count. Deleting one of the names decrements that count without ever touching the data as long as at least one name still points to that inode, the exact same mechanism that explains why a deleted file still open by a process keeps occupying disk space.

# Two names, one inode, a reference count of 2
ln original.txt hardlink.txt
ls -li original.txt hardlink.txt
# 123456 -rw-r--r-- 2 user user ... original.txt
# 123456 -rw-r--r-- 2 user user ... hardlink.txt

A symbolic link is a file in its own right, with its own inode, whose content is simply the path to another file. The kernel resolves that path on every access: if the target file disappears or moves, the symlink keeps existing, but now points to nothing, a state called a dangling symlink.

# A different inode, whose content is a plain text path
ln -s original.txt symlink.txt
ls -li original.txt symlink.txt
# 123456 -rw-r--r-- 1 user user ... original.txt
# 789012 lrwxrwxrwx 1 user user ... symlink.txt -> original.txt

A hard link can never cross a filesystem boundary (two different partitions don’t share the same inode tables), a limitation symlinks don’t have since they only store a plain text path. A hard link to a directory is also forbidden on most systems (risking loops that can’t be reliably traversed), whereas a symlink to a directory is perfectly common.

Takeaway

A hard link is one more name pointing to the same inode, incrementing its reference count: deleting the original destroys nothing as long as another name remains, the same principle that explains a deleted-but-still-open file’s persistence. A symlink is a separate file whose content is a path, resolved on every access: deleting or moving the target leaves a dangling link, broken but still present. Hard links can neither cross a filesystem boundary nor point to a directory, two limitations that don’t exist for symlinks, since a plain text path carries neither constraint by nature.