Engineering Craft › Developer Tooling
Getting Help (man, --help, tldr)
Reading a command's built-in documentation.
Also known as: man, --help, tldr, manual pages
Command-line tools come with built-in documentation. Learning to read it means you can answer “what does this flag do?” in seconds, without leaving the terminal.
The three levels
ls --help # a short summary of options (works for most tools)
man ls # the full manual page
tldr ls # community-written, example-first cheat sheet (install it separately)
man opens a pager. Use these keys:
| Key | Does |
|---|---|
Space / b | next / previous page |
/word then n | search, and jump to the next match |
q | quit |
How a man page is organized
- NAME: one-line description.
- SYNOPSIS: the command’s shape. Square brackets
[ ]mean optional,|means “or”, and...means repeatable. - DESCRIPTION and OPTIONS: every flag.
- EXAMPLES, SEE ALSO, and sometimes EXIT STATUS.
SYNOPSIS
grep [OPTION...] PATTERNS [FILE...]
Finding things
man -k "copy files" # search manual descriptions (same as apropos)
which python # where a command lives
type cd # is it a built-in, an alias or a program?
Tips
- Start with
--helportldrfor quick examples, andmanwhen you need the details. - Flags differ between systems (GNU/Linux vs macOS). If an option isn’t accepted, check the local
manpage, not an online answer for another system. - Shell built-ins like
cdare documented in the shell’s own manual (help cdin bash). - Tools without man pages often have
tool helpor online docs (reading docs).