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.
help [-d | -m | -s] [PATTERN...] info [OPTION]... [MENU-ITEM...] COMMAND --help
Try it
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.
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
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
helpis Bash only. Insh(dash) there is nohelp. Useman dash.man bashhas everything about builtins, but is huge.help NAMEfinds the builtin faster.infois often not installed (packageinfoortexinfo) and its key bindings differ fromless. If you dislike it,info NAME | lessorpinfohelps.--helpvs-h:-hcan mean "human-readable" (df -h) and not "help".--helpis 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 printfshows both the builtin and/usr/bin/printf.help printfdocuments the builtin,man printfdocuments the program. - Searching documentation:
aproposfinds commands by a keyword;help | grep wordsearches builtins. tldrpages are a separate community project (not part of Linux): short examples per command.
Related
man,apropos,type- Lessons: Getting help, Shell basics