tldr/pages/common/tac.md

26 lines
597 B
Markdown
Raw Normal View History

2015-12-28 21:01:39 +00:00
# tac
> Display and concatenate files with lines in reversed order.
> See also: `cat`.
> More information: <https://www.gnu.org/software/coreutils/tac>.
2015-12-28 21:01:39 +00:00
- Concatenate specific files in reversed order:
2015-12-28 21:01:39 +00:00
`tac {{path/to/file1 path/to/file2 ...}}`
2015-12-28 21:01:39 +00:00
- Display `stdin` in reversed order:
2020-02-08 14:48:47 +00:00
`{{cat path/to/file}} | tac`
2020-02-08 14:48:47 +00:00
- Use a specific [s]eparator:
2015-12-28 21:01:39 +00:00
`tac -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
- Use a specific [r]egex as a [s]eparator:
`tac -r -s {{separator}} {{path/to/file1 path/to/file2 ...}}`
- Use a separator [b]efore each file:
`tac -b {{path/to/file1 path/to/file2 ...}}`