Also known as: symlink, soft link, symbolic link
A symbolic link (or symlink, or "soft link") is a special file whose contents are a path to another file or directory. When a program opens a symlink, the kernel follows it to the target and opens that instead. Symlinks can cross filesystem boundaries, point to directories, and point to nonexistent targets (a "dangling" symlink).
Create and manage them with ln -s:
ln -s /var/www/html ~/www # create
ls -l ~/www # shows "www -> /var/www/html"
readlink ~/www # print the target
readlink -f ~/www # resolve fully
rm ~/www # remove the symlink, not the target
Symlinks differ from hard links in that the symlink is an independent inode pointing to a name, while a hard link is just a second directory entry pointing to the same inode. Hard links cannot span filesystems and usually cannot point to directories; symlinks can do both.
Symlinks are used everywhere in Linux: /bin often symlinks to /usr/bin, /etc/resolv.conf might symlink to /run/systemd/resolve/stub-resolv.conf, kernel module trees contain many symlinks for architecture compatibility. When chasing the real location of a file, readlink -f is indispensable.
Related terms: Hard Link
Discussed in:
Also defined in: Textbook of Linux