Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • So would the solution here be to sort twice? Once for catching uniqs properly, and again for display purposes? Commented Nov 2, 2015 at 17:46
  • 1
    If you just want the data sorted (as in sort | uniq | sort) then the second sort doesn't do anything (uniq doesn't unsort it). If you want it sorted by the count (as in sort | uniq -c | sort -n), then yes you'd need two sorts because the second sort order is potentially different. Commented Nov 2, 2015 at 17:48