mirror of
https://github.com/nushell/nushell.git
synced 2024-12-27 01:19:25 +01:00
8c0a2d3c15
* Finish updating * a couple improvements * Update renames * cleanup examples
51 lines
821 B
Markdown
51 lines
821 B
Markdown
---
|
|
title: sort-by
|
|
layout: command
|
|
version: 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
|
|
```shell
|
|
> [2 0 1] | sort-by
|
|
```
|
|
|
|
sort the list by decreasing value
|
|
```shell
|
|
> [2 0 1] | sort-by -r
|
|
```
|
|
|
|
sort a list of strings
|
|
```shell
|
|
> [betty amy sarah] | sort-by
|
|
```
|
|
|
|
sort a list of strings in reverse
|
|
```shell
|
|
> [betty amy sarah] | sort-by -r
|
|
```
|
|
|
|
Sort strings (case-insensitive)
|
|
```shell
|
|
> echo [airplane Truck Car] | sort-by -i
|
|
```
|
|
|
|
Sort strings (reversed case-insensitive)
|
|
```shell
|
|
> echo [airplane Truck Car] | sort-by -i -r
|
|
```
|
|
|