Linux Command Explainer

Paste any shell command and get a plain-English breakdown of every argument, flag, pipe and redirection — with warnings before you run something destructive.

Read a one-liner you found on the internet? Pasted from a forum, a README or a colleague’s terminal? Type it in below and the explainer splits the line into its individual commands, then walks through each one: what the command does, what every flag means (built-in notes for 70+ common tools), how the pipes and redirections move data around — and a red flag when the command can delete files, wipe disks or break your system. Nothing is executed and nothing leaves your browser.

🔒 100% private — nothing is uploaded or stored. The command is tokenised and analysed entirely in your browser. It is never sent to a server, logged or saved — so you can safely paste commands that contain passwords, tokens, internal hostnames or paths you would rather not share.

1 · Paste a command (or a whole pipeline)

Try:

2 · The pipeline at a glance

Each chip is one command in the line, joined by the operator that connects them. Chips are coloured when they carry warnings.

3 · Safety check

4 · Command-by-command breakdown

How the shell reads a command line

Before anything runs, the shell (bash, sh, zsh…) parses the whole line. Understanding the order it works in explains almost every “why did that do that?” moment.

1. Quotes and escapes come first

  • 'single quotes' freeze everything inside: no variables, no command substitution, no escapes. echo '$HOME' prints the literal text $HOME.
  • "double quotes" still expand variables and $(...), but protect spaces and glob characters like * from being expanded by the shell.
  • A backslash \ escapes the single character after it: echo \* prints a literal asterisk.

2. The line is split into words and operators

Unquoted whitespace separates words. These characters are operators, never part of a word:

OperatorMeaning
|Pipe: feed the standard output of the left command into the standard input of the right one.
|&Pipe both stdout and stderr (bash).
&&Run the right side only if the left exited 0 (success).
||Run the right side only if the left failed (non-zero exit code).
;Run the next command regardless of the previous result.
&Run the command in the background.
> >> < <> &>Redirections (below).

3. Redirections move data between streams and files

SyntaxWhat happens
cmd > fileStdout goes to file — the file is truncated first if it exists.
cmd >> fileStdout is appended; existing content is kept.
cmd < fileStdin comes from file.
cmd 2>&1Duplicate stderr onto stdout — the classic way to capture both in one pipe or file.
cmd 2> err.logStderr goes to err.log; stdout is untouched (still on the screen).
cmd &> out.logBash shortcut: both stdout and stderr into out.log.
>> /dev/null 2>&1The idiom for “silence it completely”.

4. Variables and substitutions

  • $VAR / ${VAR} expand the variable’s value; ${VAR:-default} supplies a fallback.
  • $(command) runs a command and substitutes its output — nestable, the modern choice. Backticks `` `command` `` do the same but are harder to read and nest (legacy).
  • $? is the exit code of the last command (0 = success); $$ the shell’s PID; $1…$9 positional parameters in scripts.

5. Common pitfalls

  • Unquoted variables with spaces: rm $dir/* where $dir="/my docs" becomes two paths — quote it: rm "$dir"/*.
  • > truncates: running cat notes.txt > notes.txt empties the file before it is read. Use >> to append.
  • Pipes hide failures: in cmd1 | cmd2, the pipeline’s exit code is cmd2’s — a failure in cmd1 can go unnoticed (bash: set -o pipefail).
  • sudo applies to the whole pipeline: sudo ls | grep x runs only ls as root; grep runs as you. For the whole line: sudo sh -c 'ls | grep x'.
  • Wildcards are expanded by the shell, not the command: rm *.log — if no .log files exist, bash passes the literal *.log (and rm complains), but some shells pass nothing at all.

Luke Keam
Spot a bug or want a custom utility built? I'd love to hear from you. Get in touch
Luke Keam | techgeek.biz