<s>
In	O
computing	O
,	O
sort	O
is	O
a	O
standard	O
command	B-Application
line	I-Application
program	O
of	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
that	O
prints	O
the	O
lines	O
of	O
its	O
input	O
or	O
concatenation	O
of	O
all	O
files	B-Operating_System
listed	O
in	O
its	O
argument	O
list	O
in	O
sorted	O
order	O
.	O
</s>
<s>
The	O
command	B-Application
supports	O
a	O
number	O
of	O
command-line	B-Application
options	O
that	O
can	O
vary	O
by	O
implementation	O
.	O
</s>
<s>
A	O
command	B-Application
that	O
invokes	O
a	O
general	O
sort	O
facility	O
was	O
first	O
implemented	O
within	O
Multics	B-Application
.	O
</s>
<s>
Later	O
,	O
it	O
appeared	O
in	O
Version	B-Operating_System
1	I-Operating_System
Unix	I-Operating_System
.	O
</s>
<s>
By	O
Version	B-Operating_System
4	I-Operating_System
Thompson	O
had	O
modified	O
it	O
to	O
use	O
pipes	B-Operating_System
,	O
but	O
sort	O
retained	O
an	O
option	O
to	O
name	O
the	O
output	O
file	O
because	O
it	O
was	O
used	O
to	O
sort	O
a	O
file	O
in	O
place	O
.	O
</s>
<s>
In	O
Version	B-Operating_System
5	I-Operating_System
,	O
Thompson	O
invented	O
"	O
-	O
"	O
to	O
represent	O
standard	O
input	O
.	O
</s>
<s>
The	O
version	O
of	O
bundled	O
in	O
GNU	B-Application
coreutils	I-Application
was	O
written	O
by	O
Mike	O
Haertel	O
and	O
Paul	O
Eggert	O
.	O
</s>
<s>
This	O
implementation	O
employs	O
the	O
merge	B-Algorithm
sort	I-Algorithm
algorithm	O
.	O
</s>
<s>
Similar	O
commands	O
are	O
available	O
on	O
many	O
other	O
operating	B-General_Concept
systems	I-General_Concept
,	O
for	O
example	O
a	O
command	B-Application
is	O
part	O
of	O
ASCII	O
's	O
MSX-DOS2	O
Tools	O
for	O
MSX-DOS	B-Operating_System
version	O
2	O
.	O
</s>
<s>
The	O
command	B-Application
has	O
also	O
been	O
ported	O
to	O
the	O
IBM	B-Application
i	I-Application
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
With	O
no	O
FILE	O
,	O
or	O
when	O
FILE	O
is	O
-	O
,	O
the	O
command	B-Application
reads	O
from	O
standard	O
input	O
.	O
</s>
<s>
Name	O
Description	O
Unix	B-Application
Plan	B-Operating_System
9	I-Operating_System
Inferno	B-Operating_System
FreeBSD	B-Operating_System
Linux	B-Application
MSX-DOS	B-Operating_System
IBM	B-Application
i	I-Application
-b	O
,	O
--ignore-leading-blanks	O
Ignores	O
leading	O
blanks	O
.	O
</s>
<s>
-c	O
Check	O
that	O
input	O
file	O
is	O
sorted	O
.	O
</s>
<s>
-C	O
Like	O
-c	O
,	O
but	O
does	O
not	O
report	O
the	O
first	O
bad	O
line	O
.	O
</s>
<s>
-k,--key=POS1[,POS2]	O
Start	O
a	O
key	O
at	O
POS1	O
(	O
origin	O
1	O
)	O
,	O
end	O
it	O
at	O
POS2	O
(	O
default	O
end	O
of	O
line	O
)	O
-m	O
Merge	O
only	O
;	O
input	O
files	B-Operating_System
are	O
assumed	O
to	O
be	O
presorted	O
.	O
</s>
<s>
See	O
also	O
:	O
shuf	B-Device
-s	O
Stabilizes	O
sort	O
by	O
disabling	O
last-resort	O
comparison	O
.	O
</s>
<s>
-V	O
,	O
--version-sort	O
Natural	O
sort	O
of	O
(	O
version	O
)	O
numbers	O
within	O
text	O
-w	O
Like	O
-i	O
,	O
but	O
ignore	O
only	O
tabs	O
and	O
spaces	O
.	O
</s>
<s>
/H	O
Include	O
hidden	O
files	B-Operating_System
when	O
using	O
wild	O
cards	O
.	O
</s>
<s>
The	O
command	B-Application
produces	O
output	O
that	O
starts	O
with	O
a	O
number	O
,	O
the	O
file	O
size	O
,	O
so	O
its	O
output	O
can	O
be	O
piped	O
to	O
to	O
produce	O
a	O
list	O
of	O
files	B-Operating_System
sorted	O
by	O
(	O
ascending	O
)	O
file	O
size	O
:	O
</s>
<s>
The	O
command	B-Application
with	O
the	O
option	O
prints	O
file	O
sizes	O
in	O
the	O
7th	O
field	O
,	O
so	O
a	O
list	O
of	O
the	O
files	B-Operating_System
sorted	O
by	O
file	O
size	O
is	O
produced	O
by	O
:	O
</s>
<s>
Sorting	O
a	O
file	O
with	O
tab	B-Protocol
separated	I-Protocol
values	I-Protocol
requires	O
a	O
tab	O
character	O
to	O
be	O
specified	O
as	O
the	O
column	O
delimiter	O
.	O
</s>
<s>
to	O
specify	O
the	O
tab	O
as	O
a	O
C	B-Language
escape	I-Language
sequence	I-Language
.	O
</s>
<s>
The	O
GNU	B-Operating_System
implementation	O
has	O
a	O
-R	O
--random-sort	O
option	O
based	O
on	O
hashing	O
;	O
this	O
is	O
not	O
a	O
full	O
random	O
shuffle	O
because	O
it	O
will	O
sort	O
identical	O
lines	O
together	O
.	O
</s>
<s>
A	O
true	O
random	O
sort	O
is	O
provided	O
by	O
the	O
Unix	B-Application
utility	I-Application
shuf	B-Device
.	O
</s>
<s>
The	O
GNU	B-Operating_System
implementation	O
has	O
a	O
-V	O
--version-sort	O
option	O
which	O
is	O
a	O
natural	O
sort	O
of	O
(	O
version	O
)	O
numbers	O
within	O
text	O
.	O
</s>
