1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-07 08:06:07 +02:00
tldr/pages/common/tac.md

26 lines
687 B
Markdown
Raw Normal View History

2015-12-28 22:01:39 +01:00
# tac
> Display and concatenate files with lines in reversed order.
> See also: `cat`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/tac-invocation.html>.
2015-12-28 22:01:39 +01:00
- Concatenate specific files in reversed order:
2015-12-28 22:01:39 +01:00
`tac {{path/to/file1 path/to/file2 ...}}`
2015-12-28 22:01:39 +01:00
- Display `stdin` in reversed order:
2020-02-08 20:18:47 +05:30
`{{cat path/to/file}} | tac`
2020-02-08 20:18:47 +05:30
- Use a specific separator:
2015-12-28 22:01:39 +01:00
`tac {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}`
- Use a specific regex as a separator:
`tac {{[-r|--regex]}} {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}`
- Use a separator before each file:
`tac {{[-b|--before]}} {{path/to/file1 path/to/file2 ...}}`