Need to remove the count from the output when using “uniq -c” command

后端 未结 5 809
有刺的猬
有刺的猬 2020-12-06 13:16

I am trying to read a file and sort it by number of occurrences of a particular field. Suppose i want to find out the most repeated date from a log file then i use uniq -c o

5条回答
  •  鱼传尺愫
    2020-12-06 14:01

    an alternative solution is this:

    uniq -c | sort -nr | awk '{print $1, $2}'
    

    also you may easily print a single field.

提交回复
热议问题