How do I find a unique line in a file?

Kim Thu Đoàn

New member
How do I find a unique line in a file?
Answer
Find unique lines
  1. The file must be sorted first. sort file | uniq -u will output to console for you. – ma77c. …
  2. I think the reason sort file | uniq shows all the values 1 time is because it immediately prints the line it encounters the first time, and for the subsequent encounters, it just skips them. – Reeshabh Ranjan.
 

Tìm kiếm

Back
Top