Files
tldr/pages.zh/linux/tac.md

25 lines
599 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# tac
> 以反向顺序显示和连接文件的行。
> 另见:`cat`。
> 更多信息:<https://www.gnu.org/software/coreutils/tac>。
- 以反向顺序连接特定文件:
`tac {{path/to/file1 path/to/file2 ...}}`
- 以反向顺序显示 `stdin`
`{{cat path/to/file}} | tac`
- 使用特定的分隔符:
`tac --separator {{,}} {{path/to/file1 path/to/file2 ...}}`
- 使用特定的正则表达式作为分隔符:
`tac --regex --separator {{[,;]}} {{path/to/file1 path/to/file2 ...}}`
- 在每个文件之前使用分隔符:
`tac --before {{path/to/file1 path/to/file2 ...}}`