Pipes and Redirection in Linux Explained (| > >> <)

Pipes and redirection connect commands and files together, letting the output of one command become the input of another.

Published October 2, 2026

Pipes and redirection connect commands and files together, letting the output of one command become the input of another.

Key points

  • The pipe | sends the output of one command directly into the input of the next: ls | grep txt
  • > redirects output to a file, overwriting it; >> appends to the file instead of overwriting
  • < feeds a file's contents in as input to a command, e.g. mysql mydb < dump.sql

Example

ps aux | grep node > processes.txt
More Linux articles