mirror of
https://github.com/nushell/nushell.git
synced 2024-11-29 11:54:02 +01:00
c0a1d18e3d
* feat: update #4455, regenerate commands' docs * chore: update make_docs script
38 lines
553 B
Markdown
38 lines
553 B
Markdown
---
|
|
title: where
|
|
layout: command
|
|
version: 0.59.0
|
|
---
|
|
|
|
Filter values based on a condition.
|
|
|
|
## Signature
|
|
|
|
```> where (cond)```
|
|
|
|
## Parameters
|
|
|
|
- `cond`: condition
|
|
|
|
## Examples
|
|
|
|
List all files in the current directory with sizes greater than 2kb
|
|
```shell
|
|
> ls | where size > 2kb
|
|
```
|
|
|
|
List only the files in the current directory
|
|
```shell
|
|
> ls | where type == file
|
|
```
|
|
|
|
List all files with names that contain "Car"
|
|
```shell
|
|
> ls | where name =~ "Car"
|
|
```
|
|
|
|
List all files that were modified in the last two weeks
|
|
```shell
|
|
> ls | where modified <= 2wk
|
|
```
|