Linux "readlink" Command Line Options and Examples
read value of a symbolic link

Note realpath(1) is the preferred command to use for canonicalization functionality.


Usage:

readlink [OPTION]... FILE...




Command Line Options:

-f
canonicalize by following every symlink in every component of the given name recursively; all but thelast component must exist
readlink -f ...
-e
canonicalize by following every symlink in every component of the given name recursively, all compo‐nents must exist
readlink -e ...
-m
canonicalize by following every symlink in every component of the given name recursively, withoutrequirements on components existence
readlink -m ...
-n
do not output the trailing delimiter
readlink -n ...
-s
suppress most error messages (on by default)
readlink -s ...
-v
report error messages
readlink -v ...
-z
end each output line with NUL, not newline
readlink -z ...
--help
display this help and exit
readlink --help ...
--version
output version information and exitAUTHORWritten by Dmitry V. Levin.REPORTING BUGSGNU coreutils online help: <http://www.gnu.org/software/coreutils/>Report readlink translation bugs to <http://translationproject.org/team/>COPYRIGHTCopyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later<http://gnu.org/licenses/gpl.html>.This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent per‐mitted by law.
readlink --version ...