tac

Concatenate and write files in reverse, copies each FILE (`-' means standard input), or standard input if none are given, to standard output, reversing the records (lines by default) in each separately

SYNTAX
      tac [OPTION]... [FILE]...

OPTIONS

-b
--before
     The separator is attached to the beginning of the record that it
     precedes in the file.

-r
--regex
     Treat the separator string as a regular expression.  Users of `tac'
     on MS-DOS/MS-Windows should note that, since `tac' reads files in
     binary mode, each line of a text file might end with a CR/LF pair
     instead of the Unix-style LF.

-s SEPARATOR
--separator=SEPARATOR
     Use SEPARATOR as the record separator, instead of newline.

"Records" are separated by instances of a string (newline by default). By default, this separator string is attached to the end of the record that it follows in the file.

"The best is the enemy of the good" - Voltaire

Related commands:

cat - Display the contents of a file
comm - Compare two sorted files line by line
csplit - Split a file into context-determined pieces
paste - Merge lines of files
sort - Sort text files
split
- Split a file into fixed-size pieces

Equivalent Windows NT commands:

none



Back to the Top

Simon Sheppard
SS64.com