Ubuntu – How to distinguish between a command, utility, or builtin for getting documentation

command linedocumentationinfomanpage

I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.

Best Answer

You can use type to find out:

$ type echo
echo is a shell builtin
$ type sudo
sudo is /usr/bin/sudo

For bash builtins, use help, as in help echo.

Related Question