Terminal Power User: Pipes, Redirects & Processes
Combine simple commands into powerful pipelines
Combine simple commands into powerful pipelines
Unix was built on a powerful idea: make small tools that each do one thing well, then combine them. This simple concept changed computing forever.
Each command has a single purpose. sort sorts. grep searches. wc counts. Simple and focused.
Commands read text input and produce text output. This common format lets any command talk to any other.
The pipe (|) connects commands together. One command's output becomes the next command's input.
The pipe operator | takes the output of one command and feeds it directly into the next. Build powerful pipelines by chaining simple commands together.
Click commands to build a pipeline and see the data transform at each step!
● Start with a source ● Add transforms
By default, command output appears on your screen. Redirects let you save that output to a file instead.
Click each step in order to run it and watch how the file changes.
> creates the file if it doesn't exist, or completely replaces its contents if it does.
>> adds to the end of the file without destroying existing content. Great for log files!
Transform messy data into organized information. sort puts lines in order, and uniq removes duplicates.
Watch data transform as you apply different operations.
sort | uniq -c | sort -rn is one of the most useful pipelines ever. It counts how often each line appears and shows the most common ones first!
The top command gives you a live, updating view of what your computer is doing. See which processes are running, how much CPU and memory they use, and spot problems instantly.
%CPU shows how much processing power each program uses. High values mean the program is working hard.
%MEM shows RAM consumption. If total memory gets too high, your system slows down.
Every running program has a unique PID. Use it to identify and manage specific processes.
Use the terminal below to practice pipes, redirects, and more:
top in the terminal to see live processes. Press q to quit. Then try building your own pipelines with ls | sort or echo "hello" > file.txt!
You've mastered pipes, redirects, sort, uniq, and process monitoring. These tools turn beginners into power users!
Small tools that do one thing well, combined together for complex tasks.
Send the output of one command directly into the input of another.
Save command output to files. Use > to overwrite, >> to append.
Organize and deduplicate data. The classic sort | uniq -c counts occurrences.
Use top to watch running processes, CPU usage, and memory in real time.
Put your new knowledge into practice!