February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Sorts or merges files.
Syntax
sort [-m] [-o output_file] [-Abdfinru] [-k keydef]... [-t character] [-T directory] [-y] [kilobytes] [-z record_size]... file...
Options
-m performs a merge.
-b ignores leading spaces and tabs.
-f treats lowercase as uppercase.
-k keydef specifies one or more sort keys (start byte, end byte).
-n sorts any initial numeric strings.
-r reverses the order.
-u means no duplicates in output.
Oddities
No separate merge command exists.
Example
$ sort buzz # Standard sort #! /bin/ksh do done integer x=17 while : x=17 $ sort -r buzz # Descending sort x=17 while : integer x=17 done do #! /bin/ksh $ $ sort -k 3,1 buzz # Use one byte found after skipping three as # the sort key #! /bin/ksh do done ...
Read now
Unlock full access