// A field guide for the terminal-curious

The command line,
demystified.

Every developer tool you'll ever use speaks the same language. Learn the grammar once and you can read any command ever written.

bash — 80×24
~/projects $ git commit --message "first commit"
[main (root-commit) a3f9d12] first commit
3 files changed, 47 insertions(+)
~/projects $ git push -u origin main
Enumerating objects: 5, done.
Branch 'main' set up to track 'origin/main'.
~/projects $
01 / What you're looking at

The terminal, the shell,
and the command line.

You'll hear these three terms thrown around interchangeably, but they're slightly different things:

Terminal

The window on your screen. It's just the display — like a TV. Also called a terminal emulator because it simulates the hardware terminals of the 70s. iTerm2, Windows Terminal, Hyper — all terminals.

🐚
Shell

The program running inside that terminal. It reads what you type and actually runs things. bash, zsh, fish, and PowerShell are all shells.

💬
Command Line

The line where you type — and loosely, the whole text-based way of controlling a computer. "CLI" means Command Line Interface. As opposed to a GUI (Graphical User Interface — buttons, windows, mice).

The prompt is the little symbol at the start of each line (usually $ or >). It means "I'm ready, type something." Everything after it is what you type.
02 / The anatomy of a command

One grammar.
Every tool.

Almost every CLI command you'll ever run follows the exact same structure. Learn this and you can read — and guess — commands you've never seen before.

git
commit
--message
"fix the bug"
command — the tool itself
subcommand — what action to do
flag / option — modifier, starts with -
argument — the thing to act on

Everything is separated by spaces. The order matters: command first, then subcommand, then the rest (usually). That's the whole syntax.

One thing you'll notice immediately: flags sometimes start with one dash (-m) and sometimes two (--message). The rule is simple: one dash = shorthand, one letter. Two dashes = full word. They're the same flag, just two ways to write it. The short version is faster to type; the long version is easier to read at a glance — especially in scripts that other people have to understand later. Most flags offer both.

03 / Commands & subcommands

Tools within tools.

Modern CLI tools are organized like a toolbox with compartments. You have one top-level command — the tool's name — and inside it live all the specific actions as subcommands. You'll also hear them called verbs or just sub-commands.

git alone does nothing useful. git commit, git push, git clone — those are the real actions. git is the namespace; the subcommands are the verbs.

This pattern is everywhere — it's basically an industry standard for any serious tool:

git
git clone
git commit
git push
git pull
git checkout
docker
docker run
docker build
docker pull
docker ps
docker stop
npm
npm install
npm run
npm publish
npm update
npm audit

Notice that git pull and docker pull both use pull. Different tools, same verb. CLI designers try to use conventional, intuitive words so you can guess subcommands before you even look them up.

▸ Click any part to learn what it is
docker   run   -d   -p   8080:80   nginx
← Click any highlighted word above
04 / Flags & options

The modifiers.
The dashes explain it.

The rule for spotting a flag: it starts with a dash. That's it. One dash or two — here's the difference:

-f

Short flag

Single dash + single letter. Fast to type. Often called a short option. You can usually chain several together: -abc means -a -b -c.

--force

Long flag

Double dash + full word. Self-documenting — anyone reading your command knows exactly what it means. Preferred in scripts and documentation.

Most flags have both forms — they're identical. -m and --message in git do the exact same thing. Short is for speed, long is for clarity.

Examples — same result, different style
git commit -m "quick fix"
git commit --message "quick fix"
Both commit your code with the message "quick fix". The long form is just more readable.
Flags with values vs flags without values: --message needs a value after it (the message text). But --verbose is a pure on/off switch — you either include it or you don't. The second kind is often called a boolean flag or a switch.
Special case — the double dash
git checkout -- filename.txt
A bare -- (double dash alone) is a convention meaning "everything after this is an argument, not a flag." Mostly used to avoid ambiguity. You'll see it occasionally — just know what it is.
05 / Arguments

The thing you're
acting on.

An argument (also called a positional argument) is a plain value — no dashes — that tells the command what to work with. A filename, a URL, a branch name, a number. It's called positional because the order you write them in matters.

Arguments in the wild
git clone https://github.com/user/repo.git
The URL is the argument — what to clone.
git checkout main
The branch name is the argument — which branch to switch to.
cp file.txt backup.txt
Two arguments: source first, destination second. Order matters — swap them and you'd overwrite the wrong file.

Flags modify how. Arguments say what. Together they give the command everything it needs.

06 / Git — a real-world walkthrough

Git as the
perfect example.

Git is the version control system almost every developer uses. It's also a textbook example of CLI design — clean subcommands, consistent flags, and good defaults. Let's decode the most common commands:

Clone — copying a repo from the internet
git clone https://github.com/user/project.git
git = tool  ·  clone = action  ·  URL = what to clone. That's the whole command.
Add + commit — saving a snapshot of your work
git add .
The . is an argument meaning "everything in this folder." Stage all changed files.
git commit -m "add login page"
-m is short for --message. The text in quotes is the value for that flag.
Push — sending your commits to GitHub
git push -u origin main
-u (set upstream) only needed the first time. origin = the remote's nickname, main = the branch.
Log — viewing history (with formatting flags)
git log --oneline --graph --all
Three boolean flags stacked together. Each one adds something: compact view, ASCII branch graph, show all branches. Combine flags freely.
Slang you'll hear: "committing" = saving a snapshot locally. "Pushing" = uploading to the remote (GitHub/GitLab). "Pulling" = downloading updates from the remote. "Branching" = creating a parallel line of work. "Merging" = joining two branches together. "The repo" = the repository, i.e. the project folder with all its history.
07 / Getting unstuck

How to ask the
tool itself.

Every well-built CLI tool documents itself. You never need to Google a flag if you know these:

The universal help flags
git --help
git -h
git commit --help
The last one is key: add --help after any subcommand to get help specifically for that action.
man pages — the manual
man git-commit
man is a command itself — short for "manual." It opens the full documentation. Press q to quit. Not on Windows by default, but universal on Mac/Linux.

A well-formatted help output always shows the same things:

usage: git commit [<options>] [--] <pathspec>...

-q, --quiet suppress summary after successful commit
-v, --verbose show diff in commit message template
-m, --message <message> commit message
--amend amend previous commit
--no-edit use selected commit message without editing
-n, --no-verify bypass pre-commit and commit-msg hooks

Read the usage line like this: square brackets [like this] = optional. Angle brackets <like this> = required value goes here. Ellipsis ... = you can repeat it.

08 / Cheatsheet

The core
git workflow.

These ~10 commands cover 90% of daily git usage. Everything else is edge cases.

git init
Turn the current folder into a git repo
git clone <url>
Copy a remote repo to your machine
git status
See what's changed since your last commit
git add .
Stage all changes (ready to commit)
git commit -m "msg"
Save a snapshot with a message
git push
Upload your commits to the remote
git pull
Download & merge changes from the remote
git branch <name>
Create a new branch
git checkout <name>
Switch to a different branch
git log --oneline
See recent commits, one per line
The mental model: a command is a sentence. The tool (git) is the subject. The subcommand (commit) is the verb. The argument (filename) is the object. The flags (--message) are the adverbs. Read it like English, left to right.