NAME
readlink — display
the contents of a symbolic link
SYNOPSIS
readlink |
[-n] file |
DESCRIPTION
If the file operand names a symbolic link, the
readlink utility shall not follow the symbolic link
when resolving file and shall write the contents of the
symbolic link to standard output. If the -n option
is not specified, the output to standard output shall be followed by a
<newline> character.
If file does not name a symbolic link,
readlink shall write a diagnostic message to
standard error and exit with non-zero status.
OPTIONS
The readlink utility shall conform to XBD
V1_chap12(7).
The following option shall be supported:
-n- Do not output a trailing <newline> character.
OPERANDS
The following operand shall be supported:
- file
- A pathname of a symbolic link to be read.
STDIN
Not used.
INPUT FILES
None.
ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of
readlink:
LANG- Provide a default value for the internationalization variables that are unset or null. (See XBD 8.2 Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
LC_ALL- If set to a non-empty string value, override the values of all the other internationalization variables.
LC_CTYPE- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files).
LC_MESSAGES-
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH- [
XSI] Determine the location of messages objects and message catalogs.
ASYNCHRONOUS EVENTS
Default.
STDOUT
See DESCRIPTION.
STDERR
The standard error shall be used only for diagnostic messages.
OUTPUT FILES
None.
EXTENDED DESCRIPTION
None.
EXIT STATUS
The following exit values shall be returned:
CONSEQUENCES OF ERRORS
Default.
APPLICATION USAGE
None.
EXAMPLES
None.
RATIONALE
The readlink utility was added because
using ls(1) -l to obtain the
contents of a symbolic link is difficult if the output includes more than
one occurrence of the string " ->
".
The -f option found in many
implementations was not included, as the realpath(1)
utility provides equivalent functionality with a choice of behaviors.
FUTURE DIRECTIONS
None.
SEE ALSO
XBD V1_chap08(7), V1_chap12(7)
XSH readlink(3)
CHANGE HISTORY
First released in Issue 8.