最新消息:阿啰哈,本人90后,目前单身,欢迎妹子们来撩!.(。→‿←。)

How to colorize your log files with ccze

Commands 林志斌 527浏览

ccze is a wonderful tool that brings real joy to the arduous task of reading or searching thru log files. #nerdalert
We’ve been using ccze for years but recently stumbled (um, actually, rtfm’d) upon the “missing” feature – the ability to output the colorized results in a format that can be piped to grep.
tail -f /var/log/syslog | ccze -A | grep login will result in grep results made pretty and readable by ccze – not revolutionary, but very handy. And pretty.
ccze -A < /path/to/log/file | less -R
ccze also colorizes  ruby, apache, dhcp and most other types of log files and data files, try it out, you’ll be happy you did!

Install ccze on Ubuntu / Debian with: apt-get install ccze
ccze -h will give you HTML output
Below is a quick video showing tail -f on an active DHCP server log with and without ccze.

http://www.askapache.com/linux/elite-log-file-scrolling-color-syntax.html
https://unix.stackexchange.com/questions/43570/get-colors-in-less-command-with-ccze-shift-g-doesnt-go-to-the-end-of-file
http://blog.tersmitten.nl/how-to-colorize-your-log-files-with-ccze.html
http://www.outsideopen.com/the-colorful-magic-of-ccze/

转载请注明:林志斌 » How to colorize your log files with ccze

发表评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址