Bash build-in commands
The following commands, typed directly at the prompt without slashes (no directory) will be run inside bash.
If you think for a moment, you will see that this is a very handy feature. Imagine that for any reason, the system is in trashing or with CPU at 100%, you can not open terminal and you only have the console with a bash prompt. You try to run “top” but the system tells you that it cannot launch the command. What can you do to kill the hung program that is eting the 100% of the CPU?
If you have bash running in the console, what about using the build-in commands to kill the offending program?
Find in the GNU Bash documentation the official built-in command list.
Built-in command | First in |
---|---|
: (a colon) | sh |
. (a period) | sh |
[ | sh |
alias | bash |
bg | bash |
bind | bash |
break | sh |
builtin | bash |
caller | bash |
cd | sh |
command | bash |
compgen | bash |
complete | bash |
compopt | bash |
continue | sh |
declare | bash |
dirs | bash |
disown | bash |
echo | bash |
enable | bash |
eval | sh |
exec | sh |
exit | sh |
export | sh |
fc | bash |
fg | bash |
getopts | sh |
hash | sh |
help | bash |
history | bash |
jobs | bash |
kill | bash |
let | bash |
local | bash |
logout | bash |
mapfile | bash |
popd | bash |
printf | bash |
pushd | bash |
pwd | sh |
read | bash |
readarray | bash |
readonly | sh |
return | sh |
set | sh |
shift | sh |
shopt | bash |
source | bash |
test | sh |
times | sh |
trap | sh |
type | bash |
typeset | bash |
ulimit | bash |
umask | sh |
unalias | bash |
unset | sh |
wait | sh |