nushell/docs/commands/sort-by.md
JT 8c0a2d3c15
Auto-generate markdown command docs (#4451)
* Finish updating

* a couple improvements

* Update renames

* cleanup examples
2022-02-13 21:22:51 -05:00

821 B

title layout version
sort-by command 0.59.0

Sort by the given columns, in increasing order.

Signature

> sort-by ...columns --reverse --insensitive

Parameters

  • ...columns: the column(s) to sort by
  • --reverse: Sort in reverse order
  • --insensitive: Sort string-based columns case-insensitively

Examples

sort the list by increasing value

> [2 0 1] | sort-by

sort the list by decreasing value

> [2 0 1] | sort-by -r

sort a list of strings

> [betty amy sarah] | sort-by

sort a list of strings in reverse

> [betty amy sarah] | sort-by -r

Sort strings (case-insensitive)

> echo [airplane Truck Car] | sort-by -i

Sort strings (reversed case-insensitive)

> echo [airplane Truck Car] | sort-by -i -r