AlgoMaster Logo

Hard and Symbolic Links

High Priority39 min readUpdated August 14, 2026

Suppose a deployment directory contains:

The service always reads from current, while the deployment system updates where that name points.

Elsewhere, a backup tool may want two filenames to refer to the exact same file without copying its contents.

Both cases use links, but in different ways:

  • A hard link creates another directory entry for the same inode.
  • A symbolic link creates a separate file that stores a path to another location.

A hard link points directly to the same file-system object. A symbolic link points to it indirectly through a pathname.

This difference explains their behavior across file systems, renames, deletions, inode numbers, and link counts.

This chapter compares the namespace structures and lifetimes of hard and symbolic links, explains link counts, restrictions, relative targets, dangling links, loops, removal behavior, practical uses, and security risks.

Premium Content

Subscribe to unlock full access to this content and more premium articles.