{
    "mode": "man",
    "parameter": "tac",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/tac/1/json",
    "generated": "2026-06-03T04:25:33Z",
    "synopsis": "tac [OPTION]... [FILE]...",
    "sections": {
        "NAME": {
            "content": "tac - concatenate and print files in reverse\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tac [OPTION]... [FILE]...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Write each FILE to standard output, last line first.\n\nWith no FILE, or when FILE is -, read standard input.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-b --before",
                    "content": "attach the separator before instead of after\n",
                    "flag": "-b",
                    "long": "--before"
                },
                {
                    "name": "-r --regex",
                    "content": "interpret the separator as a regular expression\n",
                    "flag": "-r",
                    "long": "--regex"
                },
                {
                    "name": "-s --separator",
                    "content": "use STRING as the separator instead of newline\n\n--help display this help and exit\n",
                    "flag": "-s",
                    "long": "--separator"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Jay Lepreau and David MacKenzie.\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": "rev(1)\n\nFull documentation <https://www.gnu.org/software/coreutils/tac>\nor available locally via: info '(coreutils) tac invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                      TAC(1)",
            "subsections": []
        }
    },
    "summary": "tac - concatenate and print files in reverse",
    "flags": [
        {
            "flag": "-b",
            "long": "--before",
            "arg": null,
            "description": "attach the separator before instead of after"
        },
        {
            "flag": "-r",
            "long": "--regex",
            "arg": null,
            "description": "interpret the separator as a regular expression"
        },
        {
            "flag": "-s",
            "long": "--separator",
            "arg": null,
            "description": "use STRING as the separator instead of newline --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "rev",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/rev/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Display and concatenate files with lines in reversed order.",
        "examples": [
            {
                "description": "Concatenate specific files in reversed order",
                "command": "tac {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Display `stdin` in reversed order",
                "command": "{{cat path/to/file}} | tac"
            },
            {
                "description": "Use a specific separator",
                "command": "tac {{-s|--separator}} {{separator}} {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Use a specific `regex` as a separator",
                "command": "tac {{-r|--regex}} {{-s|--separator}} {{separator}} {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Use a separator before each file",
                "command": "tac {{-b|--before}} {{path/to/file1 path/to/file2 ...}}"
            }
        ]
    }
}