The examples in this section demonstrate some of the features and uses of the sort utility. The examples assume LC_ALL is set to C and the following file named list is in the working directory:
$ cat listTom Winstrom 94201Janet Dempsey 94111Alice MacLeod 94114David Mack 94114Toni Barnett 95020Jack Cooper 94072Richard MacDonald 95510
This file contains a list of names and ZIP codes. Each line of the file contains three fields: the first name field, the last name field, and the ZIP code field. For the examples to work, the blanks in the file must be SPACEs, and not TAB s.
The first example demonstrates sort without any options—the only argument is the name of the input file. In ...