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 pathCopy-ready examples
$ readlink -f /etc/passwdResolved absolute pathYou 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.
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