where for database

Includes a where statement for a query

Signature

> where (where)

Parameters

  • where: Where expression on the table

Examples

selects a column from a database with a where clause

> open db.sqlite
    | from table table_1
    | select a
    | where ((field a) > 1)
    | describe

where for filters

Filter values based on a condition.

Signature

> where (cond) --block

Parameters

  • cond: condition
  • --block {block}: use where with a block or variable instead

Examples

List all files in the current directory with sizes greater than 2kb

> ls | where size > 2kb

List only the files in the current directory

> ls | where type == file

List all files with names that contain "Car"

> ls | where name =~ "Car"

List all files that were modified in the last two weeks

> ls | where modified >= (date now) - 2wk