help (shell builtin)
Overview
help shows documentation for shell builtins — commands implemented inside the shell itself (cd, export, read, [[, declare, job control, etc.), not as separate binaries under /usr/bin. External programs use --help or man instead.
If man cd looks wrong or minimal, you are probably looking at a stub; the real reference is help cd (bash) or the shell’s own manual.
Syntax
help [-dms] [pattern ...]Bash-oriented options (check help help on your shell):
| Option | Description |
|---|---|
-d |
Short description only |
-m |
Manpage-like layout |
-s |
Short usage synopsis |
| pattern | Builtin name or pattern to match |
Common Options / discovery helpers
| Command | Description |
|---|---|
help |
List topics / usage overview |
help name |
Full builtin help |
type name |
How the shell resolves name |
type -a name |
All candidates (builtin + PATH) |
command -v name |
Path or builtin indicator |
compgen -b |
List bash builtins |
enable -a |
Enabled/disabled builtins |
Examples with Explanations
Read builtin docs
help cd
help [[
help declare
help read
help -m printf # man-like layout for the builtin printf
help | less # browse all topicsBuiltin vs external
type cd # builtin
type ls # usually /usr/bin/ls (hashed)
type -a echo # may show builtin and /usr/bin/echo
type -a kill # often both: shell kill + /bin/kill
help cd # works for builtin
ls --help # external GNU flag
man ls # full external manualPrefer type / command -v in scripts over which for resolving names.
List builtins (bash)
compgen -b | column
compgen -b | grep -E '^(cd|pushd|popd|dirs)$'
enable -a | headDisable / re-enable a builtin (rare, debugging)
enable -n echo # force external echo next
type echo
enable echo # restore builtinUseful when testing whether a weird echo behavior comes from the builtin or a shadowed binary.
Conditional help in interactive setups
# only define an alias if the real command exists
if type -P rg >/dev/null; then
alias grep='rg'
fitype -P searches PATH only (ignores builtins/aliases/functions).
Job-control and shell language topics
help jobs
help fg
help bg
help wait
help trap
help set
help shoptThese are not separate man pages in the same way; learn them via help + man bash.
Notes / Pitfalls
helpis primarily for interactive humans. Non-interactive scripts still run builtins; they just don’t needhelp.- zsh uses
run-help(often bound toEsc-h) and different docs; fish integrates web/local docs underhelp. help printfis the shell printf;man 1 printf/man 3 printfare different tools/APIs.- Aliases and functions shadow names:
type foobefore assuming you are reading the right help. - BusyBox / dash environments have smaller builtin sets; don’t assume full bash
helptext.
2026-relevant notes
- Bash 5.x remains the default interactive shell on many servers;
helptext tracks your installed bash, not a website. - For deep language reference (arrays, coprocs,
mapfile, loadable builtins), combinehelpwithman bash/info bash. - In containers, shells are often
bashorsh→dash; verify withecho $0andhelpavailability.
Additional Resources
help help,man bash- Bash Reference Manual