← Shell Scripting (Bash) learning pathShell Scripting (Bash) · Module 4 of 10
Pipes, redirection and filters
Combine small commands into powerful pipelines.
📖 Key ideas
- | sends one command's output to another: ls | wc -l.
- grep searches text: grep "error" app.log.
- sort, uniq, cut, tr transform text.
- 2> redirects errors; &> redirects everything.
- /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