Files and folders

The ln command

Creates links: a shortcut to another file on the system.

Syntax

ln [-s] <destino> <nombre-del-enlace>

Most useful options

-sCreates a symbolic (soft) link

Copy-ready examples

$ ln -s Documentos accesoLink to a folder
$ ln Documentos/apuntes.txt copia-duraHard link

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • A symbolic link breaks if you delete the original.

Related commands

FAQ

Soft or hard link?

The soft one (-s) points to the path; the hard one shares the file data.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course