Linux tac倒序查看文本内容

Linuxtac大约 981 字

taccat的倒序。

  • cat:Concatenate FILE(s), or standard input, to standard output.
  • tac: Write each FILE to standard output, last line first.

应用

查找请求日志时,从底部找到最新的一个请求。

tac info.log | grep 'keywords' -m 1

帮助文档

Usage: tac [OPTION]... [FILE]...
Write each FILE to standard output, last line first.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -b, --before             attach the separator before instead of after
  -r, --regex              interpret the separator as a regular expression
  -s, --separator=STRING   use STRING as the separator instead of newline
      --help     display this help and exit
      --version  output version information and exit

Report tac bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'tac invocation'
阅读 478 · 发布于 2019-08-23

————        END        ————

扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看换一批