Hands-on Lab·LPIC-1
Streams, pipes and redirection
Topic 103 is weight 23, the largest on either paper, and this is its foundation. A pipe carries standard output and nothing else, which is why a command that prints an error to a pipeline appears to lose it. This guide proves that with a command that writes to both streams at once, then shows the redirection order that catches people out.
101: GNU and Unix Commands Guide 8 of 33 Beginner
- OSUbuntu 26.04 LTS
- Kernel7.0.0-30-generic
- systemd259
- TimeAbout 16 min
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC1-A01 | 192.168.0.76 | Ubuntu 26.04 LTS | Debian-family host - dpkg and apt, which objective 102.4 names | 2 Core | 4 GB | 50 GB |
This guide includes
Use this for the foundation of the largest topic on either paper. This matters because a pipe carries stdout and only stdout - and swapping two tokens sends the errors somewhere else entirely.
- seeing that a pipe carries stdout, and only stdout
- finding that the order of the redirections is the question people miss
- using
tee, for when the output is needed twice
Before you start
-
A file to work on
-
A pipe carries stdout, and only stdout
-
Order matters, and this is the question people miss
-
tee, for when you need the output twice