# mt find

Find tasks that contain every word you give

It takes the same flags as `mt ls`.

`mt find login bug` runs `mt ls 'contains("login") && contains("bug")'`. So every `ls` flag works, and the `applied:` line shows the filter. `[ls] contains-fields` sets the fields a bare `contains()` searches, as [Filters](https://mlavrinenko.github.io/mindtape/filters/index.md) describes. To search one field, use a filter: `mt ls 'contains("bug", title)'`.

Runs on every project of a [set](https://mlavrinenko.github.io/mindtape/read-many-projects/index.md) too. `mt @work find` searches every project and prints one table, a `PROJECT` column first.

- `<TERM>…`: Words to search for
  A task matches when it contains every word.
  `repeatable`
- `--format <FORMAT>`: Output format
  - `table`: An aligned table
  - `json`: A JSON object with the tasks and how mt picked them
  - `csv`: Comma-separated values with a header row
  - `path`: One task file path per line, to hand to another program, as in `rg TODO $(mt ls ready --format path)`
  - `path0`: Paths as for `path`, each ending in a NUL byte, for `xargs -0` and paths with spaces`default: table`
- `--json`: Same as `--format json`
- `-n, --limit <LIMIT>`: Show at most N tasks, after filtering and sorting
  A table says how many it left out.
- `--skip <SKIP>`: Skip the first N rows after sorting
  For page two of `-n 20`, use `--skip 20`. When `--limit` cuts the table off, its footer shows the `--skip` for the next page.
- `--sort <SORT>…`: Sort by a field, such as `--sort due:asc`
  Repeat it to break ties, or pass `@view` to sort as that view does.
  `repeatable`
- `--columns <COLS>`: The columns to show, comma-separated, or `@view` for a view's columns
- `-i, --interactive`: Pick a task from the table and open it in your editor
  Type a task's hash to highlight it, and press Enter to open it. Needs a terminal.
- `--hyperlinks <WHEN>`: When to make the `slug#` and `file` columns clickable links
  Defaults to `[ls] hyperlinks`, which is `never` unless your project changes it.
  - `auto`: Links when the output is a terminal and `TERM` isn't `dumb`. Some terminals show the link codes as garbage
  - `always`: Always print links
  - `never`: Never print links

```sh
mt find redis                   # one term
mt find login token             # several terms conjoin (AND)
mt find redis --sort priority:desc -n 3   # every ls flag forwards
mt find email --format path | xargs wc -l
```

Every command also takes the [global flags](https://mlavrinenko.github.io/mindtape/cli/index.md#global-flags).
