๐Ÿ“– L3 of 5 ยท M0โฑ 5 min

Running commands

A command is a name, then optional flags, then optional arguments. That's the whole grammar.

1The shape of a command

command  --flag  argument
ls         -la       /Users/you
  • command โ€” the program you want to run (ls, tailscale, docker)
  • flags โ€” modifiers, usually starting with - or --
  • arguments โ€” the thing the command operates on (a path, a name, a URL)

Most commands let you type name --help to see what flags they accept. Tailscale itself: tailscale --help.

2Two flag styles

You'll see both:

  • -a, -l โ€” short flags, one dash, one letter. Often combinable: -la = -l -a.
  • --accept-routes, --ssh โ€” long flags, two dashes, full word(s). More readable, can't be combined.

Many flags have both: -h and --help usually do the same thing.

3When something needs admin

Some commands need administrator rights โ€” installing software, starting a service, editing system files. On macOS and Linux you prefix the command with sudo ("super-user do"):

sudo tailscale up

The terminal will ask for your password. Type it (you won't see the characters appear โ€” that's normal) and hit Enter.

Be deliberate with sudo. It bypasses safety checks. If a tutorial asks you to run something with sudo, glance at what the command does before you run it. Random snippets from the internet can be destructive โ€” see L5.

Deep-path detail: on Windows, the equivalent is "Run as Administrator." In WSL, you use sudo like on Linux. PowerShell has its own admin escalation โ€” right-click Windows Terminal and "Run as administrator."

4Stopping a command

If a command is running and you want to kill it, press Ctrl + C. This sends an interrupt signal โ€” most programs stop immediately and clean up.

If Ctrl + C doesn't work, Ctrl + D sometimes does (it sends "end of input" โ€” useful for things waiting on you to type something). Closing the terminal window also works as a last resort.

5Try it

echo "hello there" --help    # echo doesn't have flags, but you'll see how text is treated
ls --help                    # or `man ls` on macOS/Linux for the full manual
sleep 5                      # waits 5 seconds, then returns the prompt
sleep 100                    # now press Ctrl+C to interrupt it

That's the whole skill. Read the help, run the command, hit Ctrl+C if you need to bail.

๐Ÿง Knowledge check

Three quick questions

Pick an answer to see why.

Q1.What does sudo do?
Q2.A command is running and won't return your prompt. What's the first thing to try?
Q3.What does tailscale --help do?
3 / 3
Solid.