Getting Help: man, –help, tldr

The Linux developers who built every command you use also wrote documentation for it — in your terminal, instantly available, no internet required. Knowing how to read it is what separates “Googles every command” from “self-sufficient on any system.”

1. man (the manual)

man opens the full manual page for a command. This is the canonical source.

man ls          # full manual for ls
man chmod
man bash        # huge — bash's manual is 5000+ lines

Reading a man page

Inside man, you’re using the less pager. Useful keys:

Space / f      next page
b              previous page
/text          search for "text"
n              next match
q              quit

Man page sections

Some commands exist in multiple sections (e.g. printf the shell command vs printf the C function):

man 1 printf    # section 1: user commands
man 3 printf    # section 3: C library functions
man -k crypt    # search all man pages for "crypt"

Common sections: 1 (commands), 2 (system calls), 3 (libraries), 5 (file formats), 7 (overviews), 8 (admin commands).

2. –help (the quick reference)

Most commands respond to --help or -h with a brief usage summary. Faster than man for “what flags does this take?”

ls --help
grep --help
docker run --help

The output is shorter, focuses on flags, and fits on one screen.

3. tldr (the practical examples)

tldr shows community-curated examples of common usage. Faster than reading a man page when you just want “how do I tar this folder?”

Install:

# Debian/Ubuntu
sudo apt install tldr

# Fedora
sudo dnf install tldr

# Mac
brew install tldr

Use:

tldr tar
tldr ssh
tldr find

You get 5-10 real examples per command. This is what you wish man pages started with.

4. info (GNU’s alternative to man)

GNU tools sometimes have richer documentation in info format. You’ll rarely use this, but know it exists:

info coreutils 'ls invocation'

5. apropos (find commands by description)

Forget the command name but remember what it does?

apropos "compress"
apropos "list directory"
man -k "list directory"     # same thing

6. which / type / whatis (what is this command?)

which python      # /usr/bin/python  — where the binary is
type python        # alias / function / file?
whatis grep        # one-line description from the man page

The right tool for the job

Question Use
“How do I do X with command Y?” tldr Y
“What’s the exact flag for X?” Y --help
“What does this entire command do?” man Y
“I forgot the command name” apropos "what it does"
“Where is this binary?” which X

What to learn next

Once you can find out what commands do, the next leverage is chaining them together with pipes and redirects — the Unix superpower.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *