[CentOS] Sort logfiles on common lines?

Dotan Cohen dotancohen at gmail.com
Mon Sep 26 23:19:08 UTC 2011


On Sun, Sep 25, 2011 at 22:43, John R Pierce <pierce at hogranch.com> wrote:
> uniq can count occurances.  will require two sorts.  one to get all
> similar errors adjacent, the other to sort by count order.   instead of
> using field selects, lets just clip the timestamps off up front...
>
>   cut -c 17- | sort | uniq -c | sort -rn
>
> (17- means from char 17 on... I may have miscounted)
>

Thank you John! That is perfect! I'm going through the uniq manpage
now. Have a great night!

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com



More information about the CentOS mailing list