How to grep number of unique occurrences

前端 未结 3 1574
鱼传尺愫
鱼传尺愫 2021-01-12 09:12

I understand that grep -c string can be used to count the occurrences of a given string. What I would like to do is count the number of unique occurrences when

3条回答
  •  無奈伤痛
    2021-01-12 09:51

    This worked perfectly... Thanks to everyone for your comments!

    grep -oP "wwn=[^,]*" path/to/file | sort | uniq -c

提交回复
热议问题