sort-by
for filters> sort-by {flags} ...rest
--reverse, -r
: Sort in reverse order--ignore-case, -i
: Sort string-based columns case-insensitively--natural, -n
: Sort alphanumeric string-based columns naturally (1, 9, 10, 99, 100, ...)...rest
: the column(s) to sort byinput | output |
---|---|
list<any> | list<any> |
table | table |
Sort files by modified date
>ls|sort-bymodified
Sort files by name (case-insensitive)
>ls|sort-byname-i
Sort a table by a column (reversed order)
> [[fruitcount]; [apple9] [pear3] [orange7]] |sort-byfruit-r
╭───┬────────┬───────╮
│# │ fruit │ count │
├───┼────────┼───────┤
│0│pear│3│
│1│orange│7│
│2│apple│9│
╰───┴────────┴───────╯
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/sort-by.html