How do I get unique lines in a file?

Lượng Tiger

New member
How do I get unique lines in a file?
Answer
Find unique lines
  1. The file must be sorted first. sort file | uniq -u will output to console for you. – …
  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. –
 

Tìm kiếm

Back
Top