tldr/pages/common/tac.md

17 lines
452 B
Markdown
Raw Normal View History

2015-12-28 21:01:39 +00:00
# tac
2020-02-08 14:48:47 +00:00
> Print and concatenate files in reverse (last line first).
2021-03-30 14:55:44 +01:00
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/tac-invocation.html>.
2015-12-28 21:01:39 +00:00
- Print the contents of *file1* reversed to the standard output:
2015-12-28 21:01:39 +00:00
`tac {{file1}}`
2020-02-08 14:48:47 +00:00
- Print the contents of the standard input reversed to the standard output:
`{{command}} | tac`
- Concatenate several files reversed into the target file:
2015-12-28 21:01:39 +00:00
`tac {{file1}} {{file2}} > {{target_file}}`