// COMMAND CHAIN

Build the command using pipes and redirects

Score
0
Streak
0
Level
1

Select Difficulty

How Pipes & Redirects Work

Chain commands together to build powerful one-liners:

  • | - Pipe: sends output of left command to input of right command
  • > - Redirect stdout to file (overwrites)
  • 2> - Redirect stderr to file

Example: ls | grep log | wc -l

This lists files → filters for "log" → counts the results

Common Commands

  • ls - List directory contents
  • cat - Display file contents
  • grep - Search for patterns
  • wc - Count lines, words, characters
  • sort - Sort lines
  • uniq - Filter duplicate lines
  • head, tail - First/last lines of file
  • awk - Text processing
  • xargs - Build command from input
  • find - Search for files
  • du - Disk usage
  • systemctl - Control system services
  • netstat - Network statistics
🏆
Victory!
You've mastered Command Chain!