The type command allows to display information about the command type. It means whether a Linux command is alias to some other command, built-in shell command, etc. This tutorial shows how to get information about command using
type command in Linux.
For example, to find the type of the
echo command, run the following command:
echo is a shell builtin
type command also accepts multiple arguments:
type echo rm ls
echo is a shell builtin rm is /usr/bin/rm ls is aliased to `ls --color=auto'
Get only command type
-t option allows to display a single word that describes the type of the command. Available values:
Get command path
-P option allows to determine the location of a command on the disk.
type -P echo
In order to get all locations that contain the command, use
type -a echo
echo is a shell builtin echo is /usr/bin/echo echo is /bin/echo
Leave a CommentCancel reply