opscape

Explain a command line

Paste a line from a script, a README or a forum answer. It is split the way bash splits it, and each piece is explained: commands and their options (from this site's notes on 149 commands), pipes, redirections, quoting, variables, globs, command substitution and subshells.

Runs entirely in your browser. Nothing you paste leaves the page.

Try one

What it does and does not do

The explainer reads the line the way bash would before running it: it finds the operators (|, &&, ||, ;, &), the redirections (>, 2>&1, here-documents and here-strings), the quoting, and the expansions inside each word ($var, ${var:-default}, $(command), $((arithmetic)), globs, braces and ~). Command substitutions and the commands run by xargs, find -exec, sudo, timeout and similar wrappers are explained in turn.

Options are explained only from the notes on this site's command pages. If an option is not in them, the explainer says so and suggests the manual, rather than inventing a meaning. It does not run anything, and it does not know what files exist on your machine, so it cannot tell you what a glob will match.

It is tested against a corpus of 121 command lines with hand-checked expected breakdowns on every rebuild; see the methodology.