Name
sort —
\windows\system32\sort.exe
Synopsis
Sort text or the contents of text files in alphanumeric order.
Syntax
sort [/r] [/+n] [/mkilobytes] [/llocale] [/recrecordbytes] [/t [tempdir]] [/ooutputfilename] [filename]
Description
The sort command sorts text on a line-by-line
basis. Each line of the input is ordered alphanumerically and output
to the screen (or optionally, stored in a file). By default, sorting
starts with the character in the first column of each line, but this
can be changed with the /+n option.
sort is often used in conjunction with either
pipes or output redirection (both discussed earlier in this chapter).
That is, you might want to sort the output of another command, and
you will often want to redirect the output to a file so that it can
be saved. sort takes the following options:
-
/r Reverses the sort order; that is, it sorts Z to A and then 9 to 0
-
/+n Sorts the file according to characters in column
n.-
/mkilobytes Specifies amount of main memory to allocate for the sort operation in kilobytes. The default is 90 percent of available memory if both the input and output are files, and 45 percent of memory otherwise. The minimum amount of memory sort will use is 160 Kb; if the available (or specified) memory is insufficient,
sortwill split the operation up using temporary files.-
/llocale Overrides the system default locale (see Control Panel → Regional and Language Options). The “C” locale yields the fastest collating sequence, and in Windows XP, is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access