Linux readlink command

Updated: 04/26/2017 by Computer Hope

About readlink

readlink prints the value of a symbolic link or canonical file name.

readlink syntax

readlink [OPTION]... FILE

Options

-f, --canonicalize Canonicalize by following every symlink in every component of the given name recursively; all but the last component must exist.
-e, --canonicalize-existing Canonicalize by following every symlink in every component of the given name recursively, all components must exist.
-m, --canonicalize-missing Canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence.
-n, --no-newline Do not output the trailing newline.
-q, --quiet Suppress most error messages.
-s, --silent Suppress error messages.
-v, --verbose Report error messages.
--help Display help and exit.
--version Output version information and exit.

readlink examples

readlink symbolic-link-name

Displays the full, canonical pathname of the symbolic link symbolic-link-name.

ln — Create a link, or a symbolic link, to a file or directory.