Sorting a file under UNIX is easy, right? Of course it is, if all
you want to do is sort a list of single words, or sort lines starting
with the first character in the line. But if you want to do more
than that, there's a lot more to the sort
command than typing:
describes how to select individual fields from a line for sort
to operate on.
describes how to change the field delimiter from "white space" to
some other character.
describes the kinds of problems that you can encounter if fields
delimited by white space.
clarifies the distinctions between alphabetic and numeric sorting.
gives miscellaneous hints about useful sort
But learning the mechanics of sort
isn't the end of the story.
Like most of the other things you'll find in the UNIX toolbox,
is even more powerful when it's used with other programs.
For example, you can:
Sort paragraphs, or other multiline entries (article
Sort lines by how long they are (article
Sort a list of names by last name, whether or not there's a middle
name as well (article