version 1.48, 2015/03/21 21:19:25 |
version 1.49, 2015/03/21 21:30:58 |
|
|
.Nm |
.Nm |
uses entire lines for comparison. |
uses entire lines for comparison. |
.Pp |
.Pp |
|
If no |
|
.Ar file |
|
is specified, or if |
|
.Ar file |
|
is |
|
.Sq - , |
|
the standard input is used. |
|
.Pp |
The options are as follows: |
The options are as follows: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
.It Fl C, Fl Fl check=silent|quiet |
.It Fl C, Fl Fl check=silent|quiet |
|
|
.Fl c , |
.Fl c , |
.Nm |
.Nm |
also checks that there are no lines with duplicate keys. |
also checks that there are no lines with duplicate keys. |
.It Fl Fl version |
|
Print the version and exit. |
|
.It Fl Fl help |
|
Print the help text and exit. |
|
.El |
.El |
.Pp |
.Pp |
The following options override the default ordering rules. |
The following options override the default ordering rules. |
|
|
and |
and |
.Xr gzip 1 |
.Xr gzip 1 |
utilities meet these requirements. |
utilities meet these requirements. |
.It Fl Fl random-source Ns = Ns Ar filename |
|
For random sort, the contents of |
|
.Ar filename |
|
are used as the source of the |
|
.Sq seed |
|
data for the hash function. |
|
Two invocations of random sort with the same seed data will use |
|
produce the same result if the input is also identical. |
|
By default, the |
|
.Xr arc4random_buf 3 |
|
function is used instead. |
|
.It Fl Fl debug |
.It Fl Fl debug |
Print some extra information about the sorting process to the |
Print some extra information about the sorting process to the |
standard output. |
standard output. |
|
|
The file names must be separated by NUL |
The file names must be separated by NUL |
(like the output produced by the command |
(like the output produced by the command |
.Dq find ... -print0 ) . |
.Dq find ... -print0 ) . |
.It Fl Fl radixsort |
|
Try to use radix sort, if the sort specifications allow. |
|
The radix sort can only be used for trivial locales (C and POSIX), |
|
and it cannot be used for numeric or month sort. |
|
Radix sort is very fast and stable. |
|
.It Fl H, Fl Fl mergesort |
|
Use mergesort. |
|
This is a universal algorithm that can always be used, |
|
but it is not always the fastest. |
|
.It Fl Fl qsort |
|
Try to use quick sort, if the sort specifications allow. |
|
This sort algorithm cannot be used with |
|
.Fl u |
|
and |
|
.Fl s . |
|
.It Fl Fl heapsort |
.It Fl Fl heapsort |
Try to use heap sort, if the sort specifications allow. |
Try to use heap sort, if the sort specifications allow. |
This sort algorithm cannot be used with |
This sort algorithm cannot be used with |
.Fl u |
.Fl u |
and |
and |
.Fl s . |
.Fl s . |
|
.It Fl Fl help |
|
Print the help text and exit. |
|
.It Fl Fl mergesort , Fl H |
|
Use mergesort. |
|
This is a universal algorithm that can always be used, |
|
but it is not always the fastest. |
.It Fl Fl mmap |
.It Fl Fl mmap |
Try to use file memory mapping system call. |
Try to use file memory mapping system call. |
It may increase speed in some cases. |
It may increase speed in some cases. |
.El |
.It Fl Fl qsort |
.Pp |
Try to use quick sort, if the sort specifications allow. |
The following operands are available: |
This sort algorithm cannot be used with |
.Bl -tag -width indent |
.Fl u |
.It Ar file |
and |
The pathname of a file to be sorted, merged, or checked. |
.Fl s . |
If no |
.It Fl Fl radixsort |
.Ar file |
Try to use radix sort, if the sort specifications allow. |
operands are specified, or if a |
The radix sort can only be used for trivial locales (C and POSIX), |
.Ar file |
and it cannot be used for numeric or month sort. |
operand is |
Radix sort is very fast and stable. |
.Fl , |
.It Fl Fl random-source Ns = Ns Ar filename |
the standard input is used. |
For random sort, the contents of |
|
.Ar filename |
|
are used as the source of the |
|
.Sq seed |
|
data for the hash function. |
|
Two invocations of random sort with the same seed data will use |
|
produce the same result if the input is also identical. |
|
By default, the |
|
.Xr arc4random_buf 3 |
|
function is used instead. |
|
.It Fl Fl version |
|
Print the version and exit. |
.El |
.El |
.Pp |
.Pp |
A field is defined as a maximal sequence of characters other than the |
A field is defined as a maximal sequence of characters other than the |