Use Shell script to retrieve max number of users' activity in a file -


Recording, example to send email records to different users while viewing a / var / log / messages file as to:

  20140912 Chris sendingemails_id00012jjdi3x 20140912 Chris sendingemails_id00012jjdiji 20140912 Allen sendingemails_id00012jwciscl 20,140,914 Chris sendingemails_id00012jjdiji 20,140,915 Linda sendingemails_id042555jwciscl 20,140,915 Chris sendingemails_id00012jjdiji 20,140,916 sendingemails_id005hhbxxsscl Allen 20140917 Chris sendingemails_id2221d2rwaaiji 20,140,917 Linda sendingemails_id00012baseeqcl 20,140,918 Chris sendingemails_id45677tehhwaaiji  

Now, I User sends requires most emails to retrieve can I do this? Thanks a lot.

It should help:

  cat / var / log / Message | Grep "sendemails_" | | Awk '{print $ 2}' | | Sort | Uniq -c  

Or to get the username exactly:

  cat / var / log / messaes | Grep "sendemails_" | | Awk '{print $ 2}' | | Sort | UNIK-C | Sort-R | Head-1 Awk '{print $ 2}' ' 

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -