For example, when I type man fg
, or man history
, the same manpage, BUILTIN(1)
will be displayed. There is a list of commands, but not the specification of their usage. Where can I find them?
How to Open the Manual. To use man , you type man on the command line, followed by a space and a Linux command. man opens the Linux manual to the “man page” that describes that command—if it can find it, of course. The man page for man opens.
To view all the man pages for a particular topic, use the “-a” option. You'll see the lowest-number man page first. When you exit that page, and press “Enter” the next man page will appear. The above command will display the man page of printf(1) command first.
bash defines the following built-in commands: :, ., [, alias, bg, bind, break, builtin, case, cd, command, compgen, complete, continue, declare, dirs, disown, echo, enable, eval, exec, exit, export, fc, fg, getopts, hash, help, history, if, jobs, kill, let, local, logout, popd, printf, pushd, pwd, read, readonly, ...
In computing, a shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute. Shell builtins work significantly faster than external programs, because there is no program loading overhead.
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 bash 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With