{
    "mode": "man",
    "parameter": "rev",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/rev/1/json",
    "generated": "2026-07-07T04:38:37Z",
    "synopsis": "rev [option] [file...]",
    "sections": {
        "NAME": {
            "content": "rev - reverse lines characterwise\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "rev [option] [file...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The rev utility copies the specified files to standard output, reversing the order of\ncharacters in every line. If no files are specified, standard input is read.\n\nThis utility is a line-oriented tool and it uses in-memory allocated buffer for a whole\nwide-char line. If the input file is huge and without line breaks than allocate the memory\nfor the file may be unsuccessful.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-V --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        },
        "SEE ALSO": {
            "content": "tac(1)\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The rev command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                       REV(1)",
            "subsections": []
        }
    },
    "summary": "rev - reverse lines characterwise",
    "flags": [
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "tac",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/tac/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Reverse a line of text or a file.",
        "examples": [
            {
                "description": "Reverse text typed into terminal",
                "command": "rev"
            },
            {
                "description": "Reverse the text string \"hello\"",
                "command": "echo \"hello\" | rev"
            },
            {
                "description": "Reverse an entire file and print to `stdout`",
                "command": "rev {{path/to/file}}"
            },
            {
                "description": "Use '\\0' as a line separator (zero termination)",
                "command": "rev {{-0|--zero}} {{path/to/file}}"
            },
            {
                "description": "Display help",
                "command": "rev {{-h|--help}}"
            },
            {
                "description": "Display version",
                "command": "rev {{-V|--version}}"
            }
        ]
    }
}