Home/Glossary/Symbolic link

Symbolic link

A special file type that stores a text path to another file or directory, acting as a transparent pointer for the operating system.

A symbolic link, or symlink, is a file system entry that functions as a pointer to another file or directory. Unlike a hard link, which shares the same inode as the target, a symlink contains a text string representing the destination path. If the target file is moved or deleted, the symlink persists but becomes "broken" or "dangling" because it no longer points to a valid location.

The operating system resolves symlinks by intercepting file access calls and redirecting them to the stored path. This abstraction allows symlinks to span across different partitions, physical drives, or network file systems. This flexibility makes them a core tool for software deployment and system administration in both Unix-like systems and Windows.

Practical Use Cases

  • Software Versioning: Pointing a generic binary name like python to a specific versioned executable.
  • Disk Space Management: Moving large datasets to secondary storage while keeping them accessible via original paths.
  • Development Environments: Linking shared libraries into multiple project directories without duplicating data.

In Unix environments, the command ln -s /source/path /link/name creates a symlink. You can identify it in a terminal using ls -l, where the link is marked with an l flag and an arrow -> pointing to its source. The disk space consumed is negligible, as it only stores the character string of the path.