Help with "sort"

Hello everyone,

Can anyone explain me what's the difference between:

and

?

thank you

In this example there is no difference. In sort -u, the -u may be influenced by the use of other sort options, whereas in sort | unix the uniq is not influenced by the use of sort options.

To expand a little on what Scott said, the output of the commands:

sort -u <other sort operands>

and

sort <other sort operands> | uniq

will be identical as long as the "other sort operands" specify a set of sort keys that include every character in the lines being sorted. The uniq utility will only throw away lines that are entire line is not unique. The sort utility with the -u option will throw away lines that have have sort keys that are unique even if some other parts of the line are different.