ShellCommand Expert
← Back to the explainer

Shell Guides

Read a command before you run it — especially if you copied it from the internet.

Why read a command first

Most shell commands are safe. The dangerous ones look almost identical to the safe ones. A single extra flag can turn "list what's here" into "delete what's here", and a pipe can turn a read-only command into one that overwrites a file. The gap between the two is usually one character.

A 4-step read-before-run checklist

  1. Find the command itself. The first word is the program. Everything after it is either an option or an argument.
  2. Decode the flags. Short flags cluster (-czvf is four flags). Long flags are self-describing but easy to skim past (--exclude, --force).
  3. Look at what it writes, not just what it reads. Redirects (>), -o, -i, --in-place, rm, mv, and dd all change state. > truncates a file before the command even runs.
  4. Check the pipe. What the last command in the pipe does is what actually happens; the earlier ones only produce its input.

Flags that change what a command does to your data

Reading a long command, worked example

Take tar -czvf backup.tar.gz --exclude='*.log' ./src:

Now you know exactly which file it creates and what it will contain — before running it.

Read one of these next

When a command is a script in disguise

curl … | sh and wget -O- … | bash execute whatever the remote server decides to send at that moment. The content can change after you read it. Download it, read it, then run it — or paste it here to get a breakdown of what it does.

Explain a command →
About Contact Privacy
© 2026 Shell Command Expert