Linux readlink command

Updated: 11/06/2021 by Computer Hope
readlink command

On Unix-like operating systems, the readlink command prints the value of a symbolic link, or canonical file name.

This page describes the GNU/Linux version of 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.

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.