Skip to content
Tutorials Center
My learning

Topics

Linux Command Reference ยท System Information

Linux info and help commands

Reference for info, help and --help: read GNU Texinfo manuals, get usage for Bash builtins with help, and use --help and type to learn about any command.

Besides man, Linux has three more places to learn about a command. help is a Bash builtin that documents the shell's own builtins (cd, read, test, declare). info opens GNU Texinfo manuals, long, hyperlinked books that the GNU project writes for tools such as coreutils, sed and bash. And almost every command accepts --help and prints a short usage summary.

Which one to use depends on what the thing is. Builtins have no manual page of their own, so help is the right tool; for an external program --help is the fastest, then man, then info for the in-depth guide.

Terminal
help [-d | -m | -s] [PATTERN...]
info [OPTION]... [MENU-ITEM...]
COMMAND --help

Try it

Bash help for Bash builtins

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Bash Choosing the right kind of help

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Syntax

Terminal
help [-dms] [PATTERN ...]
info [-f FILE] [-n NODE] [--subnodes] [MANUAL] [MENU ITEM]
Command / option Description
help List all builtins and shell keywords with their syntax.
help NAME Full help for a builtin or reserved word such as if, while, [[.
help -d NAME One-line description.
help -s NAME Only the usage line (synopsis).
help -m NAME Formatted like a manual page.
info NAME Open the Texinfo manual for NAME (falls back to the man page if none exists).
info coreutils 'ls invocation' Jump straight to a node.
info --subnodes -o - NAME Dump a whole manual as text to stdout.
COMMAND --help Short usage text of the program itself.

Keys inside info: Space/Backspace scroll, n/p next/previous node, u up, l last visited, Enter follows a menu entry or link, / search, s search again, q quit, ? help.

Returns: help exits 1 if no builtin matches (no help topics match); info exits non-zero if the manual is not found. GNU tools exit 0 for --help; an invalid option exits 1 or 2 with "Try 'cmd --help'" on stderr.

Usage notes

  • help is Bash only. In sh (dash) there is no help. Use man dash.
  • man bash has everything about builtins, but is huge. help NAME finds the builtin faster.
  • info is often not installed (package info or texinfo) and its key bindings differ from less. If you dislike it, info NAME | less or pinfo helps.
  • --help vs -h: -h can mean "human-readable" (df -h) and not "help". --help is more reliable for GNU tools; BSD and busybox tools may print usage on stderr only for a wrong option.
  • Same name, many things: type -a printf shows both the builtin and /usr/bin/printf. help printf documents the builtin, man printf documents the program.
  • Searching documentation: apropos finds commands by a keyword; help | grep word searches builtins.
  • tldr pages are a separate community project (not part of Linux): short examples per command.