Skip to content

sort

FunctionSorts lines of a page or piped input.
Options-r — reverse order.
Limitationssort requires a page path or piped input. -n and -u are not supported.

Lexicographic (string) sort. With stdin, PATH arguments are ignored. Without stdin, PATH is required. Page body is read as plain text.

$ sort ./page
$ sort -r ./page
$ ls | sort
$ ls | sort -r
$ ls | sort | head 2