Lion Cipher Lab

Combine commands with pipes, redirection, and xargs

Why it matters

The reason the command line feels like a superpower to people who are fluent in it — and a wall to everyone else — is one idea: tiny single-purpose tools snap together into exactly the tool you need, right now, that nobody shipped. That snapping-together is plumbing: a pipe hands one command's output to the next, redirection sends output into a file or throws it away, and xargs turns a list of results into the arguments for a command that would otherwise ignore it. Every other command-line skill you will ever learn — grep, sed, awk, docker, git, kubectl, every security tool — assumes you…

What you'll learn

Steps in this lab

  1. The one mental model: streams, and a pipe between them
  2. Build a sample file to drive everything (heredoc)
  3. Redirection to files: >, >>, < — and the clobber footgun
  4. See stdout and stderr as two separate channels
  5. Build a real pipeline: the top-N idiom
  6. tee: save a stream AND keep piping it
  7. xargs: when a pipe isn't enough (stdin as arguments)
  8. Chaining and exit status: ;, &&, || and $?
  9. Judgment: when plumbing is right, when it bites, and how a pro works
  10. You now own the plumbing under every command-line tool

Open the full interactive lab →