OSDN Git Service

551862eb3064c0384d9ef4e2d60579f09da8710c
[linuxjm/coreutils.git] / original / man1 / sort.1
1 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.35.
2 .TH SORT "1" "April 2010" "GNU coreutils 8.5" "User Commands"
3 .SH NAME
4 sort \- sort lines of text files
5 .SH SYNOPSIS
6 .B sort
7 [\fIOPTION\fR]... [\fIFILE\fR]...
8 .br
9 .B sort
10 [\fIOPTION\fR]... \fI--files0-from=F\fR
11 .SH DESCRIPTION
12 .\" Add any additional description here
13 .PP
14 Write sorted concatenation of all FILE(s) to standard output.
15 .PP
16 Mandatory arguments to long options are mandatory for short options too.
17 Ordering options:
18 .TP
19 \fB\-b\fR, \fB\-\-ignore\-leading\-blanks\fR
20 ignore leading blanks
21 .TP
22 \fB\-d\fR, \fB\-\-dictionary\-order\fR
23 consider only blanks and alphanumeric characters
24 .TP
25 \fB\-f\fR, \fB\-\-ignore\-case\fR
26 fold lower case to upper case characters
27 .TP
28 \fB\-g\fR, \fB\-\-general\-numeric\-sort\fR
29 compare according to general numerical value
30 .TP
31 \fB\-i\fR, \fB\-\-ignore\-nonprinting\fR
32 consider only printable characters
33 .TP
34 \fB\-M\fR, \fB\-\-month\-sort\fR
35 compare (unknown) < `JAN' < ... < `DEC'
36 .TP
37 \fB\-h\fR, \fB\-\-human\-numeric\-sort\fR
38 compare human readable numbers (e.g., 2K 1G)
39 .TP
40 \fB\-n\fR, \fB\-\-numeric\-sort\fR
41 compare according to string numerical value
42 .TP
43 \fB\-R\fR, \fB\-\-random\-sort\fR
44 sort by random hash of keys
45 .TP
46 \fB\-\-random\-source\fR=\fIFILE\fR
47 get random bytes from FILE
48 .TP
49 \fB\-r\fR, \fB\-\-reverse\fR
50 reverse the result of comparisons
51 .TP
52 \fB\-\-sort\fR=\fIWORD\fR
53 sort according to WORD:
54 general\-numeric \fB\-g\fR, human\-numeric \fB\-h\fR, month \fB\-M\fR,
55 numeric \fB\-n\fR, random \fB\-R\fR, version \fB\-V\fR
56 .TP
57 \fB\-V\fR, \fB\-\-version\-sort\fR
58 natural sort of (version) numbers within text
59 .PP
60 Other options:
61 .TP
62 \fB\-\-batch\-size\fR=\fINMERGE\fR
63 merge at most NMERGE inputs at once;
64 for more use temp files
65 .TP
66 \fB\-c\fR, \fB\-\-check\fR, \fB\-\-check\fR=\fIdiagnose\-first\fR
67 check for sorted input; do not sort
68 .TP
69 \fB\-C\fR, \fB\-\-check\fR=\fIquiet\fR, \fB\-\-check\fR=\fIsilent\fR
70 like \fB\-c\fR, but do not report first bad line
71 .TP
72 \fB\-\-compress\-program\fR=\fIPROG\fR
73 compress temporaries with PROG;
74 decompress them with PROG \fB\-d\fR
75 .TP
76 \fB\-\-files0\-from\fR=\fIF\fR
77 read input from the files specified by
78 NUL\-terminated names in file F;
79 If F is \- then read names from standard input
80 .TP
81 \fB\-k\fR, \fB\-\-key\fR=\fIPOS1[\fR,POS2]
82 start a key at POS1 (origin 1), end it at POS2
83 (default end of line)
84 .TP
85 \fB\-m\fR, \fB\-\-merge\fR
86 merge already sorted files; do not sort
87 .TP
88 \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
89 write result to FILE instead of standard output
90 .TP
91 \fB\-s\fR, \fB\-\-stable\fR
92 stabilize sort by disabling last\-resort comparison
93 .TP
94 \fB\-S\fR, \fB\-\-buffer\-size\fR=\fISIZE\fR
95 use SIZE for main memory buffer
96 .TP
97 \fB\-t\fR, \fB\-\-field\-separator\fR=\fISEP\fR
98 use SEP instead of non\-blank to blank transition
99 .TP
100 \fB\-T\fR, \fB\-\-temporary\-directory\fR=\fIDIR\fR
101 use DIR for temporaries, not $TMPDIR or /tmp;
102 multiple options specify multiple directories
103 .TP
104 \fB\-u\fR, \fB\-\-unique\fR
105 with \fB\-c\fR, check for strict ordering;
106 without \fB\-c\fR, output only the first of an equal run
107 .TP
108 \fB\-z\fR, \fB\-\-zero\-terminated\fR
109 end lines with 0 byte, not newline
110 .TP
111 \fB\-\-help\fR
112 display this help and exit
113 .TP
114 \fB\-\-version\fR
115 output version information and exit
116 .PP
117 POS is F[.C][OPTS], where F is the field number and C the character position
118 in the field; both are origin 1.  If neither \fB\-t\fR nor \fB\-b\fR is in effect, characters
119 in a field are counted from the beginning of the preceding whitespace.  OPTS is
120 one or more single\-letter ordering options, which override global ordering
121 options for that key.  If no key is given, use the entire line as the key.
122 .PP
123 SIZE may be followed by the following multiplicative suffixes:
124 % 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y.
125 .PP
126 With no FILE, or when FILE is \-, read standard input.
127 .PP
128 *** WARNING ***
129 The locale specified by the environment affects sort order.
130 Set LC_ALL=C to get the traditional sort order that uses
131 native byte values.
132 .SH AUTHOR
133 Written by Mike Haertel and Paul Eggert.
134 .SH "REPORTING BUGS"
135 Report sort bugs to bug\-coreutils@gnu.org
136 .br
137 GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
138 .br
139 General help using GNU software: <http://www.gnu.org/gethelp/>
140 .br
141 Report sort translation bugs to <http://translationproject.org/team/>
142 .SH COPYRIGHT
143 Copyright \(co 2010 Free Software Foundation, Inc.
144 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
145 .br
146 This is free software: you are free to change and redistribute it.
147 There is NO WARRANTY, to the extent permitted by law.
148 .SH "SEE ALSO"
149 The full documentation for
150 .B sort
151 is maintained as a Texinfo manual.  If the
152 .B info
153 and
154 .B sort
155 programs are properly installed at your site, the command
156 .IP
157 .B info coreutils \(aqsort invocation\(aq
158 .PP
159 should give you access to the complete manual.