![Cisco ASR 14000 Series Management Command Reference Download Page 763](http://html.mh-extra.com/html/cisco/asr-14000-series/asr-14000-series_management-command-reference_66667763.webp)
C i s c o C o n f i d e n t i a l - B e t a R e v i e w R 3 . 7. 1
Utility Commands on Cisco IOS XR Software
utility sort
SMR-761
Cisco ASR 14000 Series Router System Management Command Reference
OL-17231-01
utility sort
To sort, merge, or sequence-check the lines in one or more files, or from the standard input, use the
utility sort
command in EXEC mode or administration EXEC mode.
utility sort
[[
dict
] [
ignoreblank
] [
key
key-definition
] [
lowercase
] [
merge
] [
numeric
] [
printable
]
[
reverse
] [
unique
] [
merge
]] [
fieldSep
character
] [
file
filename
] [
outfile
filename
] [
usage
] [
WORD
]
Syntax Description
dict
(Optional) (
-d
) Sorts in dictionary order. Uses only alphanumeric and blank
characters in the sort operation.
ignoreblank
(Optional) (
-b
) Ignores leading blank characters in field comparisons.
key
key-definition
(Optional) (
-k
) Defines a key to be the sort key. A sort key field is defined
using the following syntax:
utility sort key
field_start
[
type_string
] [
,
field_end
] [
type_string
]
•
field_start
and
field_end
: Specifies the beginning and end of the key
field.
•
type_string
: Specifies attributes specific to the key.
The field_start and field_end are each specified by a pair of digits of the form
m.n, where the m refers to the field starting after the mth field separator in a
line. For field_start, the .n refers to the nth character of the specified field,
and is taken as zero if not specified. For field_end, the .n refers to the nth
character after the last character of the specified field, and is taken as zero if
not specified.
The type_string may be formed from the characters bdfinr, which apply their
defined attributes to the determination of the key.
Note
When ordering options appear independent of key field
specifications, the requested field ordering rules are applied globally
to all sort keys. When attached to a specific key, the specified
ordering options override all global ordering options for that key.
lowercase
(Optional) (
-f
) Folds uppercase letters into lowercase (ignores case and treats
upper case characters the same as lowercase characters).
merge
(Optional) (
-m
) Merges sorted files. Assumes that the files are already sorted
and so does not sort the files.
numeric
(Optional) (
-n
) Interprets the field as numeric and sorts in numeric order.
Includes the sign and optional “thousands” separator. This keyword also
ignores leading blank characters in field comparisons (implies the
ignoreblank
keyword).
printable
(Optional) (
-i
) Ignores all nonprintable characters.
reverse
(Optional) (
-r
) Reverses the sort order. The sort is ascending by default.
unique
(Optional) (
-u
) Suppresses all but one line in each set of lines having equal
keys.
fieldSep
character
(Optional) (
-t
) Specifies a character as the field separator.
file
filename
(Optional) Specifies a file to be sorted.
outfile
filename
(Optional) (
-o
) Writes the results to a file. The
filename
is the destination
disk, directory, and filename. The
filename
can be the same as the source file.