← Shell Scripting (Bash) learning path
Shell Scripting (Bash) · Module 4 of 10

Pipes, redirection and filters

Combine small commands into powerful pipelines.

📖 Key ideas

  1. | sends one command's output to another: ls | wc -l.
  2. grep searches text: grep "error" app.log.
  3. sort, uniq, cut, tr transform text.
  4. 2> redirects errors; &> redirects everything.
  5. /dev/null discards output.
💡 Real-life example: Pipes are water pipes joining machines: the output of one flows straight into the next.
|Pipe output to next command
grepSearches text by pattern
sort | uniqSorts and removes duplicates
2>Redirects error output