# cat … | grep

`cat log.txt | grep error`

Feed a file's contents into grep through a pipe.

## What each part does

- `cat` — command — print a file's contents
- `log.txt` — argument: a file, a folder, or text
- `|` — pipe: the previous command's output becomes the next one's input
- `grep` — command — find lines matching a pattern
- `error` — argument: a file, a folder, or text

Source: https://zero2vibecode.com/explain/grep-pipe
