readlink.1 (1469B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2024-04-24
- .Dt READLINK 1
- .Os
- .Sh NAME
- .Nm readlink
- .Nd print content of a symbolic link
- .Sh SYNOPSIS
- .Nm
- .Op Fl f Ns | Ns Fl e
- .Op Fl n Ns | Ns Fl z
- .Ar path
- .Sh DESCRIPTION
- Note: For canonicalization of a path, use the
- .Xr realpath 1
- utility instead for better portability.
- .Pp
- The
- .Nm
- utility reads the symbolic link of each
- .Ar path
- and prints it.
- .Pp
- If
- .Ar path
- is not a symbolic link,
- .Nm
- errors out.
- .Sh OPTIONS
- .Bl -tag -width _n
- .It Fl f
- Canonicalize
- .Ar path
- with following every symlink, all but the last path component are required to exists.
- .It Fl e
- Canonicalize
- .Ar path
- with following every symlink, all path component must exists.
- .It Fl n
- Do not print a trailing separator.
- .It Fl z
- Use NULL byte as separator instead of newlines.
- .El
- .Sh EXIT STATUS
- .Ex -std
- .Sh EXAMPLES
- Assign
- .Pa //example.org/
- to
- .Pa foobar
- and read it:
- .Bd -literal
- $ ln -s //example.org/ foobar
- $ readlink foobar
- //example.org/
- .Ed
- .Sh SEE ALSO
- .Xr ln 1 ,
- .Xr readlink 3
- .Sh STANDARDS
- .Nm
- should be compliant with the
- IEEE Std 1003.1-2024 (“POSIX.1”)
- specification.
- .Pp
- The options
- .Fl f ,
- .Fl e
- and
- .Fl z
- and support for multiple
- .Ar path
- arguments are extensions present for compatibility with existing software.
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me