commands

readlink — read symbolic link target

With no canonicalization option, prints the stored target of a symbolic link. This text can refer to a missing destination. It does not itself prove the target exists. Examples assume a fresh chapter files lab.

Formal Syntax & Structure

linux syntaxlinux
readlink [OPTION]... FILE...

Parameters & Attributes

NameTypeDescription
FILEoperandSymbolic link to inspect

Return Value

text and exit status

Without canonicalization options, GNU readlink prints the stored target of a symbolic link. A non-link operand yields nonzero status; a dangling symbolic link can still be read successfully.

Working Example

Example Snippetlinux
ln -s ../notes/hello.txt archive/shortcutreadlink archive/shortcut
Linux Reference