-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The Ultimate Linux Shell Scripting Guide
By :

This is a versatile utility that you can use by itself, or in conjunction with other utilities. You can use it to sort either one file, or multiple files together.
There are lots of options for different purposes. You can choose how to format your output, how you want the data sorted, and what fields you want to use for the sort. You can even perform sorts on two or more fields at once, with the primary sort on one field and secondary sorts on others.
There are a lot of ways that you can use sort
. As I’ve said before, the only limitation is your own imagination. To start, look at the following diagram. Create the text file on your own machine and then run the commands that you see:
Figure 6.7: Sorting the actorfile_1.txt file
What you see in the above diagram is the simplest of sorts. By default, sorts are case-sensitive and are performed on each entire line of the input file.
In the next example, I’ll show you two options at once...