manpagez: man pages & more
info coreutils
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.6 readlink: Print the referent of a symbolic link

readlink may work in one of two supported modes:

Readlink mode

readlink outputs the value of the given symbolic link. If readlink is invoked with an argument other than the name of a symbolic link, it produces no output and exits with a nonzero exit code.

Canonicalize mode

readlink outputs the absolute name of the given file which contains no ‘.’, ‘..’ components nor any repeated separators (‘/’) or symbolic links.

 
readlink [option] file

By default, readlink operates in readlink mode.

The program accepts the following options. Also see Common options.

-f
--canonicalize

Activate canonicalize mode. If any component of the file name except the last one is missing or unavailable, readlink produces no output and exits with a nonzero exit code.

-e
--canonicalize-existing

Activate canonicalize mode. If any component is missing or unavailable, readlink produces no output and exits with a nonzero exit code.

-m
--canonicalize-missing

Activate canonicalize mode. If any component is missing or unavailable, readlink treats it as a directory.

-n
--no-newline

Do not output the trailing newline.

-s
-q
--silent
--quiet

Suppress most error messages.

-v
--verbose

Report error messages.

The readlink utility first appeared in OpenBSD 2.1.

An exit status of zero indicates success, and a nonzero value indicates failure.


© manpagez.com 2000-2017
Individual documents may contain additional copyright information.