2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: where
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
2019-10-03 03:49:05 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Filter values based on a condition.
|
2019-10-03 03:49:05 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Signature
|
2020-06-23 20:21:47 +02:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
```> where (cond)```
|
2019-11-28 20:41:27 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Parameters
|
2019-11-28 20:41:27 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
- `cond`: condition
|
2019-11-28 20:41:27 +01:00
|
|
|
|
2022-02-20 02:13:33 +01:00
|
|
|
## 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
|
|
|
|
```
|