mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 09:42:24 +02:00
add documentation for get, ps
This commit is contained in:
54
docs/commands/get.md
Normal file
54
docs/commands/get.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# get
|
||||
|
||||
Open given cells as text.
|
||||
|
||||
Syntax: `get ...args`
|
||||
|
||||
### Parameters:
|
||||
|
||||
* `args`: optionally return additional data by path
|
||||
|
||||
## Examples
|
||||
|
||||
If we run `sys` we recieve a table which contains tables itself:
|
||||
|
||||
```shell
|
||||
> sys
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━
|
||||
host │ cpu │ disks │ mem │ temp │ net │ battery
|
||||
────────────────────────────────────────┼────────────────────────────────────┼────────────────┼───────────────────────────────────────┼────────────────┼────────────────┼────────────────
|
||||
[row arch hostname name release uptime │ [row cores current ghz max ghz min │ [table 7 rows] │ [row free swap free swap total total] │ [table 6 rows] │ [table 3 rows] │ [table 1 rows]
|
||||
users] │ ghz] │ │ │ │ │
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━
|
||||
```
|
||||
|
||||
To access one of the embeded tables we can use the `get` command
|
||||
|
||||
```shell
|
||||
> sys | get cpu
|
||||
━━━━━━━┯━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━
|
||||
cores │ current ghz │ min ghz │ max ghz
|
||||
───────┼───────────────────┼────────────────────┼───────────────────
|
||||
4 │ 1.530000000000000 │ 0.5000000000000000 │ 3.500000000000000
|
||||
━━━━━━━┷━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━
|
||||
```
|
||||
```shell
|
||||
> sys | get battery
|
||||
━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━
|
||||
vendor │ model │ mins to full
|
||||
────────┼──────────┼──────────────────
|
||||
SMP │ L14M2P21 │ 16.7024000000000
|
||||
━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━
|
||||
```
|
||||
|
||||
There's also the ability to pass multiple parameters to `get` which results in an output like this
|
||||
|
||||
```shell
|
||||
sys | get cpu battery
|
||||
━━━┯━━━━━━━┯━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━
|
||||
# │ cores │ current ghz │ min ghz │ max ghz │ vendor │ model │ mins to full
|
||||
───┼───────┼───────────────────┼────────────────────┼───────────────────┼────────┼──────────┼───────────────────
|
||||
0 │ 4 │ 1.500000000000000 │ 0.5000000000000000 │ 3.500000000000000 │ │ │
|
||||
1 │ │ │ │ │ SMP │ L14M2P21 │ 16.94503000000000
|
||||
━━━┷━━━━━━━┷━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━
|
||||
```
|
Reference in New Issue
Block a user