Skip to content
zero2vibecodelearn vibe coding

What cat … | grep does

cat log.txt | grep error: Feed a file's contents into grep through a pipe.

The cat command page covers what it does in general, with an example.

catlog.txt|greperror
  • 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

What it does when you run it

$ cat log.txt | grep error
error: disk full
error: retry

Run it yourself

The same files. Nothing here can break, and nothing leaves your browser.

Explain other commands

Written by Mikhail Kuzmitskii