Do you need to sort before uniq?

Ivanesn

New member
Do you need to sort before uniq?
Answer
Checking the man page for uniq: Repeated lines in the input will not be detected if they are not adjacent, so
it may be necessary to sort the files first. Alternatively, taking the man page suggestion, sorting the list before calling uniq will remove all of the duplicates.
 

Tìm kiếm

Back
Top