{
    "mode": "info",
    "parameter": "tac",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/tac/json",
    "generated": "2026-07-31T11:51:13Z",
    "sections": {
        "File: coreutils.info,  Node: tac invocation,  Next: nl invocation,  Prev: cat invocation,  Up: Output of entire files": {
            "content": "",
            "subsections": [
                {
                    "name": "3.2 'tac': Concatenate and write files in reverse",
                    "content": "'tac' copies each FILE ('-' means standard input), or standard input if\nnone are given, to standard output, reversing the records (lines by\ndefault) in each separately.  Synopsis:\n\ntac [OPTION]... [FILE]...\n\n\"Records\" are separated by instances of a string (newline by\ndefault).  By default, this separator string is attached to the end of\nthe record that it follows in the file.\n\nThe program accepts the following options.  Also see *note Common\noptions::.\n\n'-b'\n'--before'\nThe separator is attached to the beginning of the record that it\nprecedes in the file.\n\n'-r'\n'--regex'\nTreat the separator string as a regular expression.\n\n'-s SEPARATOR'\n'--separator=SEPARATOR'\nUse SEPARATOR as the record separator, instead of newline.  Note an\nempty SEPARATOR is treated as a zero byte.  I.e., input and output\nitems are delimited with ASCII NUL.\n\nOn systems like MS-DOS that distinguish between text and binary\nfiles, 'tac' reads and writes in binary mode.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n\nExample:\n\n# Reverse a file character by character.\ntac -r -s 'x\\|[^x]'\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}