O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

sort

Sorts and/or merges files

sort [options] [field-specifier-list] [file-list]

The sort utility merges and sorts one or more text files. The sort utility takes its input from files you specify on the command line or from standard input. Without the -o option sort sends its output to standard output.

Arguments

The field-specifier-list specifies one or more sort fields within each line. The sort utility uses the sort fields to sort the lines from the file-list. The file-list contains pathnames of one or more ordinary files that contain the text to be sorted. The sort utility sorts and merges the files unless you use the -m option, in which case sort only merges the files.

Options

When you do not specify an option, sort orders the file in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required