Files and folders

The readlink command

Shows where a symbolic link points. With -f it gives the resolved absolute path.

Syntax

readlink [-f] <ruta>

Most useful options

-fResolves and shows the absolute path

Copy-ready examples

$ readlink -f /etc/passwdResolved absolute path

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

Typical mistakes

  • Without -f, on a normal file it prints nothing and errors: it only works on links.

Related commands

FAQ

What is a symbolic link?

A shortcut: a file that points to another.

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