Where to view man pages for Bash builtin commands? Where to view man pages for Bash builtin commands? unix unix

Where to view man pages for Bash builtin commands?


BUILTIN commands don't have separate man pages. Those are covered by help pages. You can do:

help history

or

help fg


I have the following bash function defined in my ~/.bashrc:

bashman () {     man bash | less -p "^       $1 "}

This allows me to (in most cases) jump directly to the relevant section of the man page for the given builtin. E.g.

bashman fg

jumps directly to:

   fg [jobspec]          Resume  jobspec  in the foreground, and make it the current job.          If jobspec is not present, the shell's notion of the current job          ...

Unfortunately it doesn't work quite so well for some builtins - history is one of them. In those cases, you will have to n through the man page several times to get to the required section.


Documentation for commands that are shell builtins are with the man pages for the shell.

See for example: man bash for the history or fg command.