LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

What is the difference between a hard link and a soft link (symbolic link)?

A hard link is a second name for the very same file data (same inode); a soft link (symlink) is a tiny separate file that just stores the path to another file.

Hard link: two names point at the same inode (the data). Soft link: a symlink file storing a path points at a name, which points at the inode.

* A hard link is a second name on the same inode; a symlink is a separate file that just stores a path to a name. *

The whole difference comes down to what the link points at. A hard link points straight at the data on disk (the inode). A symlink points at a name — it's a signpost saying "go look over there." That one distinction explains every behavioural difference below:

Feature Hard link Soft link (symlink)
Points to The same inode (data itself) A path/filename
Across filesystems No (inodes are per-filesystem) Yes
Can target a directory No (usually) Yes
If the original is deleted Data survives — link still works Link dangles (points at nothing)
Command ln file hardlink ln -s file symlink

Hard links are peers — there's no "original" and "copy." All names are equal pointers to one inode, and the data isn't actually freed until the last name is removed (this is the inode's link count hitting zero). That's why deleting one hard link doesn't lose the data.

Soft links behave like Windows shortcuts: small, can cross disks, can point at directories — but fragile. Delete or move the target and the symlink becomes a dangling pointer to a name that no longer exists.

ln original.txt hardlink.txt     # another name for the same data
ln -s original.txt symlink.txt   # a pointer to the name "original.txt"
ls -l symlink.txt                # shows: symlink.txt -> original.txt

Gotcha: because a symlink stores a path, a relative symlink breaks if you move it to a different directory, while a hard link never breaks from moving — it doesn't depend on any path at all.

Go deeper:

From Quiz: LIOS / Files and Directories | Updated: Jul 14, 2026