tac
Reverse the order of input lines, outputting the last line first, for LIFO processing.
Instructions
Reverse the order of input lines (last line first). Read-only, no side effects. Returns JSON with reversed lines by default; use --raw for plain output. Use to invert line order for LIFO processing. Not for sorting — use 'sort --reverse' for reverse-sorted order. See also 'sort', 'cat'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| encoding | No | Text encoding. | utf-8 |
| max_lines | No | Maximum JSON lines to emit. | |
| paths | No | Files to reverse, or '-' for stdin. Defaults to stdin. | |
| raw | No | Write reversed text without a JSON envelope. |