We know bash supports number of buitin commands like:
$ type type cd help command
type is a shell builtin
cd is a shell builtin
help is a shell builtin
command is a shell builtin
I want to get list of all available shell builtin commands. How do I do that by command-line?
You can use
compgen -b
from a bash shell to get a list of the shell's builtin commands.From the terminal type:
From
help help
:Alternatively you can display with
enable
command: (Both @karel's and @steeldriver's answer works fine.)If any builtin is disabled then it is shown with
-n
in out put.Example output:
Another way:
man builtins
It displays the list of builtins at the top, then has all the details for each command below.
For those who hate forking external binaries simply for data formatting / extraction:
Just type in the Terminal:
This will open the manual of bash. Scroll down you will find SHELL BUILTIN COMMANDS. Here you can know about all the builtin commands and what they do. If you want the manual in a txt format, use this command
Now you have the text file of bash manual.
Well, bash is the default shell for ubuntu and the existing answers answered well.
For zshell, we can use
enable
command to list all builtins:and I get 103 builtin commands for my zshell:
Of course, we can also use
enable
to query all bash builtins: