2015-12-28 21:01:39 +00:00
|
|
|
# tac
|
|
|
|
|
2022-05-13 19:29:53 +01:00
|
|
|
> Display and concatenate files with lines in reversed order.
|
|
|
|
> See also: `cat`.
|
2021-04-01 16:54:26 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/tac>.
|
2015-12-28 21:01:39 +00:00
|
|
|
|
2022-05-13 19:29:53 +01:00
|
|
|
- Concatenate specific files in reversed order:
|
2015-12-28 21:01:39 +00:00
|
|
|
|
2022-05-13 19:29:53 +01:00
|
|
|
`tac {{path/to/file1 path/to/file2 ...}}`
|
2015-12-28 21:01:39 +00:00
|
|
|
|
2022-05-13 19:29:53 +01:00
|
|
|
- Display `stdin` in reversed order:
|
2020-02-08 14:48:47 +00:00
|
|
|
|
2022-05-13 19:29:53 +01:00
|
|
|
`{{cat path/to/file}} | tac`
|
2020-02-08 14:48:47 +00:00
|
|
|
|
2022-05-13 19:29:53 +01:00
|
|
|
- Use a specific [s]eparator:
|
2015-12-28 21:01:39 +00:00
|
|
|
|
2022-05-13 19:29:53 +01: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 ...}}`
|