All shell builtins share the same manual page:
BUILTIN(1) BSD General Commands Manual BUILTIN(1)
NAME
builtin, !
etc.
Then there is a little text describing what shell builtins are, and then a list that
looks something like this:
Command External csh(1) sh(1)
! No No Yes
% No Yes No
But if we do man grep
we get sections such as
- Bugs
- History
- See also
- Standards
- Description
etc.
Don't shell builtins have their own history, description and arguments like -A
or -r
? Why isn't that provided in the manual pages and how would I learn to use them correctly and efficiently?
Best Answer
Because builtins are part of the shell. Any bugs or history they have are bugs and history of the shell itself. They are not independent commands and don't exist outside the shell they are built into.
The equivalent, for
bash
at least, is thehelp
command. For example:All bash builtins have
help
pages. Evenhelp
itself:Inspired by @mikeserv's
sed
script, here's a little function that will print the relevant section of a man page using Perl. Add this line to your shell's initialization file (~/.bashrc
for bash):Then, you run it by giving it a man page and the name of a section: