How to find the particular text stored in the file “data.txt” and it occurs only once

前端 未结 8 1720
暗喜
暗喜 2021-01-11 17:37

The line I seek is stored in the file data.txt and is the only line of text that occurs only once.

How do I go about finding that particular line using linux?

8条回答
  •  梦毁少年i
    2021-01-11 18:30

    And one with only one tool in use, awk:

    awk '{a[$1]++}END{for(i in a){if(a[i] == 1){print i} }}' data.txt
    

提交回复
热议问题