Contents

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:

KeyDoes
Space / bnext / previous page
/word then nsearch, and jump to the next match
qquit

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 --help or tldr for quick examples, and man when you need the details.
  • Flags differ between systems (GNU/Linux vs macOS). If an option isn’t accepted, check the local man page, not an online answer for another system.
  • Shell built-ins like cd are documented in the shell’s own manual (help cd in bash).
  • Tools without man pages often have tool help or online docs (reading docs).