mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
feat: fix and update some examples (#4844)
This commit is contained in:
@ -35,3 +35,18 @@ List all rust files
|
||||
```shell
|
||||
> ls *.rs
|
||||
```
|
||||
|
||||
List all files and directories whose name do not contain 'bar'
|
||||
```shell
|
||||
> ls -s | where name !~ bar
|
||||
```
|
||||
|
||||
List all dirs with full path name in your home directory
|
||||
```shell
|
||||
> ls -f ~ | where type == dir
|
||||
```
|
||||
|
||||
List all dirs in your home directory which have not been modified in 7 days
|
||||
```shell
|
||||
> ls -s ~ | where type == dir && modified < ((date now) - 7day)
|
||||
```
|
||||
|
@ -23,6 +23,11 @@ Sum values of a list (same as 'math sum')
|
||||
> [ 1 2 3 4 ] | reduce {|it, acc| $it + $acc }
|
||||
```
|
||||
|
||||
Sum values of a list (same as 'math sum')
|
||||
```shell
|
||||
> [ 1 2 3 ] | reduce -n {|it, acc| $acc + $it.item }
|
||||
```
|
||||
|
||||
Sum values with a starting value (fold)
|
||||
```shell
|
||||
> [ 1 2 3 4 ] | reduce -f 10 {|it, acc| $acc + $it }
|
||||
|
@ -33,5 +33,5 @@ List all files with names that contain "Car"
|
||||
|
||||
List all files that were modified in the last two weeks
|
||||
```shell
|
||||
> ls | where modified <= 2wk
|
||||
> ls | where modified >= (date now) - 2wk
|
||||
```
|
||||
|
Reference in New Issue
Block a user