info > readlink

```html

๐Ÿ”— 12.6 readlink: Print value of a symlink or canonical file name

๐Ÿš€ Quick Reference

Use Case Command Description
๐Ÿ” Read symlink target readlink /path/to/symlink Outputs the value of the symbolic link (default mode)
๐Ÿงญ Resolve to canonical absolute path readlink -f /path/to/file Outputs the absolute path with no ., .., or symlinks
โœ… Resolve existing path readlink -e /path/to/file Canonicalize, require all components to exist
๐Ÿ”ฎ Resolve even missing components readlink -m /path/to/missing Canonicalize, treat missing components as directories
๐Ÿ”‡ Suppress errors readlink -q /path Quiet mode (on by default)
๐Ÿ“œ Output NUL-separated readlink -z /path Use NUL byte instead of newline (safe for embedded newlines)

๐Ÿ“ Modes of Operation

readlink may work in one of two supported modes:

๐Ÿ”— Readlink Mode

readlink outputs the value of the given symbolic links. If 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 files which contain no ., .. components nor any repeated separators (/) or symbolic links. Note the realpath command is the preferred command to use for canonicalization. See realpath invocation.

Usage: readlink [OPTION]... FILE...

By default, readlink operates in readlink mode.

โš™๏ธ Options

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

๐Ÿ“œ History

The readlink utility first appeared in OpenBSD 2.1.

The realpath command without options, operates like readlink in canonicalize mode.

๐Ÿšช Exit Codes

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

```
readlink
๐Ÿ”— 12.6 readlink: Print value of a symlink or canonical file name ๐Ÿš€ Quick Reference ๐Ÿ“ Modes of Operation
๐Ÿ”— Readlink Mode ๐Ÿงญ Canonicalize Mode
โš™๏ธ Options ๐Ÿ“œ History ๐Ÿšช Exit Codes

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 03:52 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format