help (shell builtin)
Overview
help shows documentation for shell builtins (commands implemented inside the shell, not as /usr/bin/... programs). External tools use --help or man instead.
Syntax
help [-dms] [pattern...]Bash options: | Option | Description | |——–|————-| | -d | Short description | | -m | Manpage-like format | | -s | Short usage synopsis |
Examples with Explanations
help cd
help [[
help declare
help -m printf
help | lessBuiltin vs external
type cd # builtin
type ls # usually hashed external
type -a echo # may show both
help cd # works
ls --help # external flag
man ls # full manualList builtins (bash)
compgen -b | column
enable -aNotes
- Non-interactive scripts still run builtins;
helpis for humans.
zshusesrun-help;fishhashelpintegrating web docs.
- Prefer
man bashfor deep shell language reference.