2014-05-06 14:07:05 +00:00
|
|
|
.TH SORT 1 sbase\-VERSION
|
2011-06-02 12:03:34 +00:00
|
|
|
.SH NAME
|
|
|
|
sort \- sort lines
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B sort
|
2014-05-03 18:42:33 +00:00
|
|
|
.RB [ \-bnru ]
|
2014-04-12 15:53:10 +00:00
|
|
|
.RB [ \-k
|
|
|
|
.I key
|
|
|
|
.R ]...
|
2011-06-02 12:03:34 +00:00
|
|
|
.RI [ file ...]
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B sort
|
|
|
|
writes the sorted concatenation of the given files to stdout. If no file is
|
|
|
|
given, sort reads from stdin.
|
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2014-05-03 18:42:33 +00:00
|
|
|
.B \-b
|
|
|
|
skip leading whitespace of columns when sorting.
|
|
|
|
.TP
|
2013-12-12 13:08:49 +00:00
|
|
|
.B \-n
|
|
|
|
perform a numeric sort.
|
|
|
|
.TP
|
2011-06-02 19:32:05 +00:00
|
|
|
.B \-r
|
2011-06-02 12:03:34 +00:00
|
|
|
reverses the sort.
|
2011-06-02 12:09:30 +00:00
|
|
|
.TP
|
2011-06-02 19:32:05 +00:00
|
|
|
.B \-u
|
2014-04-12 15:53:10 +00:00
|
|
|
prints equal lines only once.
|
|
|
|
.TP
|
|
|
|
.B \-k key
|
2014-05-06 14:07:05 +00:00
|
|
|
specifies a key definition of the form
|
|
|
|
.BR S [. s ][ f ][, E [. e ][ f ]]
|
2014-04-12 15:53:10 +00:00
|
|
|
where
|
2014-05-06 14:07:05 +00:00
|
|
|
.BR S ,
|
|
|
|
.BR s ,
|
|
|
|
.BR E ,
|
2014-04-12 15:53:10 +00:00
|
|
|
and
|
|
|
|
.B e
|
|
|
|
are the starting column, starting character in that column, ending column and
|
|
|
|
the ending character of that column respectively. If they are not specified,
|
2014-05-06 14:07:05 +00:00
|
|
|
.B s
|
|
|
|
refers to the first character of the specified starting column,
|
|
|
|
.B E
|
|
|
|
refers to the last column of every line, and
|
|
|
|
.B e
|
|
|
|
refers to the last character of that last column.
|
|
|
|
.B f
|
|
|
|
can be used to specify options
|
|
|
|
.RB ( n ,
|
|
|
|
.BR b )
|
|
|
|
that only apply to this key definition.
|
|
|
|
.B b
|
|
|
|
is special in that it only applies to the column that it was specified after.
|