2019-10-21 17:59:20 +02:00
|
|
|
|
2019-11-26 20:47:34 +01:00
|
|
|
# sort-by
|
2019-10-21 17:59:20 +02:00
|
|
|
|
2020-03-13 18:23:41 +01:00
|
|
|
The `sort-by` command sorts the table being displayed in the terminal by a chosen column(s).
|
2019-10-21 17:59:20 +02:00
|
|
|
|
2020-03-13 18:23:41 +01:00
|
|
|
`sort-by` takes multiple arguments (being the names of columns) sorting by each argument in order.
|
2019-10-21 17:59:20 +02:00
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
## Examples
|
2019-10-21 17:59:20 +02:00
|
|
|
|
2020-03-13 18:23:41 +01:00
|
|
|
```shell
|
2020-06-23 20:21:47 +02:00
|
|
|
> ls | sort-by size
|
2019-10-21 17:59:20 +02:00
|
|
|
━━━┯━━━━━━┯━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━
|
2020-03-13 18:23:41 +01:00
|
|
|
# │ name │ type │ readonly │ size │ accessed │ modified
|
2019-10-21 17:59:20 +02:00
|
|
|
───┼──────┼──────┼──────────┼────────┼────────────────┼────────────────
|
2020-03-13 18:23:41 +01:00
|
|
|
0 │ az │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
1 │ a │ File │ │ 18 B │ 4 minutes ago │ 38 minutes ago
|
|
|
|
2 │ ad │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
3 │ ac │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
4 │ ab │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
5 │ c │ File │ │ 102 B │ 35 minutes ago │ 35 minutes ago
|
|
|
|
6 │ d │ File │ │ 189 B │ 35 minutes ago │ 34 minutes ago
|
|
|
|
7 │ b │ File │ │ 349 B │ 35 minutes ago │ 35 minutes ago
|
2019-10-21 17:59:20 +02:00
|
|
|
━━━┷━━━━━━┷━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━
|
|
|
|
```
|
|
|
|
|
2020-03-13 18:23:41 +01:00
|
|
|
```shell
|
2020-06-23 20:21:47 +02:00
|
|
|
> ls | sort-by size name
|
2019-10-21 17:59:20 +02:00
|
|
|
━━━┯━━━━━━┯━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━
|
2020-03-13 18:23:41 +01:00
|
|
|
# │ name │ type │ readonly │ size │ accessed │ modified
|
2019-10-21 17:59:20 +02:00
|
|
|
───┼──────┼──────┼──────────┼────────┼────────────────┼────────────────
|
2020-03-13 18:23:41 +01:00
|
|
|
0 │ a │ File │ │ 18 B │ 4 minutes ago │ 39 minutes ago
|
|
|
|
1 │ ab │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
2 │ ac │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
3 │ ad │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
4 │ az │ File │ │ 18 B │ 4 minutes ago │ 4 minutes ago
|
|
|
|
5 │ c │ File │ │ 102 B │ 36 minutes ago │ 35 minutes ago
|
|
|
|
6 │ d │ File │ │ 189 B │ 35 minutes ago │ 35 minutes ago
|
|
|
|
7 │ b │ File │ │ 349 B │ 36 minutes ago │ 36 minutes ago
|
2019-10-21 17:59:20 +02:00
|
|
|
```
|
|
|
|
|
2020-06-23 20:21:47 +02:00
|
|
|
```shell
|
|
|
|
> ls | sort-by accessed
|
2019-10-21 17:59:20 +02:00
|
|
|
━━━┯━━━━━━┯━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━
|
2020-03-13 18:23:41 +01:00
|
|
|
# │ name │ type │ readonly │ size │ accessed │ modified
|
2019-10-21 17:59:20 +02:00
|
|
|
───┼──────┼──────┼──────────┼────────┼────────────────┼────────────────
|
2020-03-13 18:23:41 +01:00
|
|
|
0 │ b │ File │ │ 349 B │ 37 minutes ago │ 37 minutes ago
|
|
|
|
1 │ c │ File │ │ 102 B │ 37 minutes ago │ 37 minutes ago
|
|
|
|
2 │ d │ File │ │ 189 B │ 37 minutes ago │ 36 minutes ago
|
|
|
|
3 │ a │ File │ │ 18 B │ 6 minutes ago │ 40 minutes ago
|
|
|
|
4 │ ab │ File │ │ 18 B │ 6 minutes ago │ 6 minutes ago
|
|
|
|
5 │ ac │ File │ │ 18 B │ 6 minutes ago │ 6 minutes ago
|
|
|
|
6 │ ad │ File │ │ 18 B │ 5 minutes ago │ 5 minutes ago
|
|
|
|
7 │ az │ File │ │ 18 B │ 5 minutes ago │ 5 minutes ago
|
2019-10-21 17:59:20 +02:00
|
|
|
━━━┷━━━━━━┷━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━
|
2020-06-23 20:21:47 +02:00
|
|
|
```
|