version 1.41, 2015/03/17 17:45:13 |
version 1.42, 2015/03/19 11:38:12 |
|
|
.\" |
.\" |
.\" @(#)sort.1 8.1 (Berkeley) 6/6/93 |
.\" @(#)sort.1 8.1 (Berkeley) 6/6/93 |
.\" |
.\" |
.Dd July 3, 2012 |
.Dd $Mdocdate$ |
.Dt SORT 1 |
.Dt SORT 1 |
.Os |
.Os |
.Sh NAME |
.Sh NAME |
|
|
.Nd sort, merge, or sequence check text and binary files |
.Nd sort, merge, or sequence check text and binary files |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm sort |
.Nm sort |
.Op Fl bcCdfghiRMmnrsuVz |
.Op Fl bCcdfgHhiMnRrsuVz |
.Sm off |
.Op Fl k Ar field1 Ns Op , Ns Ar field2 |
.Op Fl k\ \& Ar field1 Op , Ar field2 |
|
.Sm on |
|
.Op Fl o Ar output |
.Op Fl o Ar output |
.Op Fl S Ar memsize |
.Op Fl S Ar size |
.Bk -words |
|
.Op Fl T Ar dir |
.Op Fl T Ar dir |
.Ek |
|
.Op Fl t Ar char |
.Op Fl t Ar char |
.Op Ar |
.Op Ar |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
|
|
.Ar output |
.Ar output |
file instead of the standard output. |
file instead of the standard output. |
This file can be the same as one of the input files. |
This file can be the same as one of the input files. |
.It Fl S Ar size, Fl Fl buffer-size Ns = Ns Ar size |
.It Fl S Ar size , Fl Fl buffer-size Ns = Ns Ar size |
Use a memory buffer no larger than |
Use a memory buffer no larger than |
.Ar size . |
.Ar size . |
The modifiers %, b, K, M, G, T, P, E, Z, and Y can be used. |
The modifiers %, b, K, M, G, T, P, E, Z, and Y can be used. |
|
|
may use up to about 90% of available memory. |
may use up to about 90% of available memory. |
If the input is too big to fit into the memory buffer, |
If the input is too big to fit into the memory buffer, |
temporary files are used. |
temporary files are used. |
|
.It Fl s |
|
Stable sort; maintains the original record order of records that have |
|
and equal key. |
|
This is a non-standard feature, but it is widely accepted and used. |
.It Fl T Ar dir , Fl Fl temporary-directory Ns = Ns Ar dir |
.It Fl T Ar dir , Fl Fl temporary-directory Ns = Ns Ar dir |
Store temporary files in the directory |
Store temporary files in the directory |
.Ar dir . |
.Ar dir . |
|
|
.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 s |
|
Stable sort; maintains the original record order of records that have |
|
and equal key. |
|
This is a non-standard feature, but it is widely accepted and used. |
|
.It Fl Fl version |
.It Fl Fl version |
Print the version and exit. |
Print the version and exit. |
.It Fl Fl help |
.It Fl Fl help |
|
|
.Ar field |
.Ar field |
argument of the key specifications. |
argument of the key specifications. |
.It Xo |
.It Xo |
.Sm off |
.Fl k Ar field1 Ns Op , Ns Ar field2 , |
.Fl k\ \& Ar field1 Op , Ar field2 , Fl Fl key Ns = Ns Ar field1 Op , Ar field2 |
.Fl Fl key Ns = Ns Ar field1 Ns Op , Ns Ar field2 |
.Sm on |
|
.Xc |
.Xc |
Define a restricted sort key that has the starting position |
Define a restricted sort key that has the starting position |
.Ar field1 , |
.Ar field1 , |