Welcome to the land of pipes (|) and redirection (> and >>) — where Linux becomes a modular masterpiece. Think of it like Lego for grown-ups (but nerdier and more powerful).
📚 Table of Contents
- What are pipes and redirection?
- Redirection Basics:
- Pipe Magic:
- Mini Mission:
- Why this rocks
- What's Next
What are pipes and redirection?
- Redirection sends output somewhere else (like a file).
- Pipes connect commands so one’s output becomes the next one’s input.
Redirection Basics:
- > — send output to a file (overwrites it)
- >> — append output to a file
Now greetings.txt contains "Hello world" and now greetings.txt has BOTH messages.
Pipe Magic:
This lists all files and sends that list to grep, which filters and only shows .txt files.
View system boot messages, but in a scrollable way. No terminal meltdown!
Mini Mission:
- Use echo to write a sentence to a file.
- Append a second line with >>
- Use a pipe to search your .bash_history for the word "sudo"
Why this rocks
This is how Linux pros build supercharged workflows. It's like chaining spells in a video game: each command is strong on its own, but together, they’re unstoppable.
What's Next
Quick Reflection:
You’ve now wrangled files, navigated directories, tamed permissions, and even filtered text like a digital detective. These new tools (grep, pipes, redirection) are your backstage passes to real-world Linux wizardry — and they're way easier than they sound.
Practice them a few times in real scenarios — not just in theory — and they’ll stick for life.
See you tomorrow for Day 10, where we wrap it all up in a command-line bow!
Top comments (0)