Linux tac 倒序查看文本内容

Linux About 985 words

说明

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'
Views: 3,285 · Posted: 2019-08-23

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

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

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


Today On History
Browsing Refresh