Skip to main content

Soft Links or Hard Links

Links allow multiple filenames to point to the same data.

TypeDescription
Soft Link (Symbolic Link)Shortcut to another file; can point to directories; breaks if target removed
Hard LinkExact reference to file data; only for files on same filesystem
CommandDescription
ln -s target linknameCreate soft link
ln target linknameCreate hard link
ls -lIdentify links (soft links show → target)

Example:

ln -s /var/log logs

This creates a shortcut named logs.