coreutils: tac invocation
1
1 3.2 ‘tac’: Concatenate and write files in reverse
1 =================================================
1
1 ‘tac’ copies each FILE (‘-’ means standard input), or standard input if
1 none are given, to standard output, reversing the records (lines by
1 default) in each separately. Synopsis:
1
1 tac [OPTION]... [FILE]...
1
1 “Records” are separated by instances of a string (newline by
1 default). By default, this separator string is attached to the end of
1 the record that it follows in the file.
1
11 The program accepts the following options. Also see ⇒Common
options.
1
1 ‘-b’
1 ‘--before’
1 The separator is attached to the beginning of the record that it
1 precedes in the file.
1
1 ‘-r’
1 ‘--regex’
1 Treat the separator string as a regular expression.
1
1 ‘-s SEPARATOR’
1 ‘--separator=SEPARATOR’
1 Use SEPARATOR as the record separator, instead of newline. Note an
1 empty SEPARATOR is treated as a zero byte. I.e., input and output
1 items are delimited with ASCII NUL.
1
1 On systems like MS-DOS that distinguish between text and binary
1 files, ‘tac’ reads and writes in binary mode.
1
1 An exit status of zero indicates success, and a nonzero value
1 indicates failure.
1
1 Example:
1
1 # Reverse a file character by character.
1 tac -r -s 'x\|[^x]'
1