Linux Command - type

type display information about command type on Linux, whether it is a builtin, alias, or file.

Syntax

1
type [-afptP] name [name ...]

Options

Option Description
-a display all locations containing name
-t tells if a command or name is an alias, shell reserved word, function, builtin or disk file.
-p path of the file to be execute or nothing if not a file
-P force a path for the command even if it is an alias, builtin or function
–help display help

Examples

Show Command Info

1
2
3
type cd # shell builtin
type ll # aliased to `ls -alF'
type ps # ps is /bin/ps

Show Command info in one world

1
2
3
type -t cd # builtin
type -t ll # alias
type -t ps # file

Show all locations of echo

1
type -a echo

output

1
2
echo is a shell builtin
echo is /bin/echo

Show the Path for ps file

1
type -p ps

output

1
/bin/ps

Show the Path for echo command

1
type -P echo

output

1
/bin/echo

Reference