Linux Pipes and Redirects
Chain commands and capture output like a shell native.
- linux pipe
- redirect stderr
- tee
- pipefail
- stdout stdin
Linux Pipes and Redirects
Chain commands and capture output like a shell native.
Commands
| Command | What it does |
|---|---|
stdout plus stderr to file | Merge streams with 2-and-1 |
append redirect | Append instead of overwrite |
pipe commands | Feed stdout into the next command |
tee save and show | See output AND save it |
feed file as stdin | Redirect a file into a command |
Example
./deploy.sh 2>&1 | tee deploy.log
grep ERROR deploy.log | head
FAQ
Does redirect order matter?
Yes - the stream merge must come last, or stderr goes to the old terminal.
Do pipelines hide failures?
Pipelines return the last command's code - set pipefail in scripts to catch mid-pipe failures.
Частые вопросы
Does redirect order matter?
Yes - the stream merge must come last, or stderr goes to the old terminal.
Do pipelines hide failures?
Pipelines return the last command's code - set pipefail in scripts to catch mid-pipe failures.
Linux
Linux Files and Directories
Navigate, create, move, and inspect files with core commands.
Linux Permissions
Read ls output, chmod, chown, and sudo without breaking access.
Linux Text Processing
cat, head, cut, sort, uniq, and awk for daily data shaping.
Linux grep and find
Find files by name, age, and size; search inside them fast.