$linuxjunkies
>

link

also: symbolic link, symlink, hard link, shortcut

A reference to a file or directory that allows access to it from another location in the filesystem. Links can be either hard links (direct references to the same inode) or symbolic links (shortcuts containing a path).

A link is a filesystem mechanism that creates an additional way to access existing files or directories. Linux supports two types: hard links and symbolic links (symlinks).

Hard links point directly to the same inode (the data structure storing file metadata and disk location). Multiple hard links to the same file are indistinguishable from each other. For example, ln original.txt backup.txt creates a hard link; both names reference identical data.

Symbolic links (created with ln -s) are special files containing a path to another file. They work like shortcuts and can point across filesystems or to directories. For example, ln -s /home/user/documents myfiles creates a symlink named myfiles pointing to the documents directory.

Hard links increase the reference count of an inode; the file is only deleted when all links are removed. Symbolic links are separate files that become invalid if their target is deleted.

Related terms