display target of symbolic link on
readlink utility when invoked with the
pathname of a symbolic link as its argument dereferences the symbolic link
and prints the name of target on standard output. If the
-f option is not specified and
readlink is invoked with an argument other than the
pathname of a symbolic link, it exits with a nonzero exit code without
The options are as follows:
- Canonicalize by following every symlink in every component of the given
readlinkwill resolve both absolute and relative paths and return the absolute pathname corresponding to file. The argument does not need to be a symbolic link.
- Do not print a trailing newline character.
readlink utility exits 0 on
success, and >0 if an error occurs.
realpath(1), readlink(2), realpath(3)
readlink utility first appeared in