{
    "mode": "man",
    "parameter": "readlink",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/readlink/1/json",
    "generated": "2026-06-17T19:32:51Z",
    "synopsis": "readlink [OPTION]... FILE...",
    "sections": {
        "NAME": {
            "content": "readlink - print resolved symbolic links or canonical file names\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "readlink [OPTION]... FILE...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Note realpath(1) is the preferred command to use for canonicalization functionality.\n\nPrint value of a symbolic link or canonical file name\n",
            "subsections": [
                {
                    "name": "-f --canonicalize",
                    "content": "canonicalize  by  following  every symlink in every component of the given name recur‐\nsively; all but the last component must exist\n",
                    "flag": "-f",
                    "long": "--canonicalize"
                },
                {
                    "name": "-e --canonicalize-existing",
                    "content": "canonicalize by following every symlink in every component of the  given  name  recur‐\nsively, all components must exist\n",
                    "flag": "-e",
                    "long": "--canonicalize-existing"
                },
                {
                    "name": "-m --canonicalize-missing",
                    "content": "canonicalize  by  following  every symlink in every component of the given name recur‐\nsively, without requirements on components existence\n",
                    "flag": "-m",
                    "long": "--canonicalize-missing"
                },
                {
                    "name": "-n --no-newline",
                    "content": "do not output the trailing delimiter\n",
                    "flag": "-n",
                    "long": "--no-newline"
                },
                {
                    "name": "-q --quiet",
                    "content": "",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "name": "-s --silent",
                    "content": "suppress most error messages (on by default)\n",
                    "flag": "-s",
                    "long": "--silent"
                },
                {
                    "name": "-v --verbose",
                    "content": "report error messages\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-z --zero",
                    "content": "end each output line with NUL, not newline\n\n--help display this help and exit\n",
                    "flag": "-z",
                    "long": "--zero"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Dmitry V. Levin.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "readlink(2), realpath(1), realpath(3)\n\nFull documentation <https://www.gnu.org/software/coreutils/readlink>\nor available locally via: info '(coreutils) readlink invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                 READLINK(1)",
            "subsections": []
        }
    },
    "summary": "readlink - print resolved symbolic links or canonical file names",
    "flags": [
        {
            "flag": "-f",
            "long": "--canonicalize",
            "arg": null,
            "description": "canonicalize by following every symlink in every component of the given name recur‐ sively; all but the last component must exist"
        },
        {
            "flag": "-e",
            "long": "--canonicalize-existing",
            "arg": null,
            "description": "canonicalize by following every symlink in every component of the given name recur‐ sively, all components must exist"
        },
        {
            "flag": "-m",
            "long": "--canonicalize-missing",
            "arg": null,
            "description": "canonicalize by following every symlink in every component of the given name recur‐ sively, without requirements on components existence"
        },
        {
            "flag": "-n",
            "long": "--no-newline",
            "arg": null,
            "description": "do not output the trailing delimiter"
        },
        {
            "flag": "-q",
            "long": "--quiet",
            "arg": null,
            "description": ""
        },
        {
            "flag": "-s",
            "long": "--silent",
            "arg": null,
            "description": "suppress most error messages (on by default)"
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "report error messages"
        },
        {
            "flag": "-z",
            "long": "--zero",
            "arg": null,
            "description": "end each output line with NUL, not newline --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "realpath",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/realpath/1/json"
        },
        {
            "name": "realpath",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/realpath/3/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Follow symlinks and get symlink information.",
        "examples": [
            {
                "description": "Get the actual file to which the symlink points",
                "command": "readlink {{path/to/file}}"
            },
            {
                "description": "Get the absolute path to a file",
                "command": "readlink {{-f|--canonicalize}} {{path/to/file}}"
            }
        ]
    }
}