100 Useful Command-Line Utilities

by Oliver; 2014

83. type

When you enter some text at the terminal prompt, that text could be a command (a binary or a script), an alias, a bash function, a bash keyword, a bash builtin, and so on. type will tell you, among these, what type of entity you're dealing with. For example, on my system:
$ type ssh
ssh is /usr/bin/ssh
This is a straight-up command, not an alias or function. But, if I've aliased quickssh to some specific ssh address, then type will reveal this:
$ type quickssh
quickssh is aliased to `ssh -Y user@myserver.edu'
Also, observe the following:
$ type if
if is a shell keyword
$ type set
set is a shell builtin
type tells us that if is a reserved word in bash, while set is a built-in command. You get the idea!

<PREV   NEXT>