Skip to main content
Symbolic links (or “soft links”) are pointers to files or directories, akin to Windows shortcuts. Unlike hard links, which reference the same inode on disk, a symlink stores the path to its target. When you access a symlink, the operating system follows that path and opens the real file or folder. Use the ln utility with the -s (or --symbolic) flag:
  • <path_to_target>: File or directory you want to reference.
  • <path_to_link>: Name (and optional path) for the symlink.
You can use absolute or relative paths. Relative links remain valid if you move the containing directory, as long as the relative structure doesn’t change.
List files with detailed info:
Output:
  • Leading l denotes a symlink.
  • Arrow (->) shows the target path.
To print only the target path without truncation:

3. Permissions and Access

Symbolic links always display full permissions (rwxrwxrwx), but actual access is governed by the target’s permissions:
Even though the symlink appears writable, you’re blocked because the real file (/etc/fstab) isn’t writable by your user.

4. Absolute vs. Relative Paths

Absolute paths may break if you rename or move parent directories:
Better: use a relative link from the same directory:
This link stays valid under /home/alex as long as the relative tree is preserved.

5. Linking Directories & Cross-Filesystem

Since symlinks store paths, you can reference directories and even across different filesystems:
The image is a diagram explaining soft links, showing how they can link to files and folders, including across different filesystems.

Further Reading

Watch Video