type, which and whereis (Display Command Information)
There are several Linux commands that give you information about Linux commands besides the man
command.
type – displays the type of a command
The type
command returns types of commands. There are largely three types.
- Shell built-in command (internal command)
- External command (shell refers to the path of a command when it executes it)
- Alias
Here are examples of the three types.
type echo
echo is a shell builtin
type find
find is /usr/bin/find
type ll
ll is aliased to `ls -alF'
which – displays the path of a command
The which
command gives you a file path of a command.
which sort
/usr/bin/sort
whereis – displays path of a command and related documents of the command
The whereis
command is similar to the which
command but gives you more information.
whereis sort
sort: /usr/bin/sort /usr/share/man/man1/sort.1.gz