Type (Unix)
Encyclopedia
type is a Unix
command that describes how its arguments would be interpreted if used as command names.
The command returns a non-zero exit status
if command names cannot be found.
test is a shell builtin
$ type cp
cp is /bin/cp
$ type unknown
-bash: type: unknown: not found
$ type type
type is a shell builtin
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
command that describes how its arguments would be interpreted if used as command names.
Function
Where applicable, type will display the command name's path. Possible command types are:- shell built-inShell builtinIn computing, a shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute....
- function
- alias
- hashed command
- keyword
The command returns a non-zero exit status
Exit status
The exit status or return code of a process in computer programming is a small number passed from a child process to a parent process when it has finished executing a specific procedure or delegated task...
if command names cannot be found.
Examples
$ type testtest is a shell builtin
$ type cp
cp is /bin/cp
$ type unknown
-bash: type: unknown: not found
$ type type
type is a shell builtin
See also
- List of Unix utilities
- command (shell builtin)
- which (Unix)Which (Unix)which is a Unix command used to identify the location of executables.The command takes one or more arguments; for each of these arguments, it prints to stdout the full path of the executable that would have been executed if this argument had been entered into the shell. It does this by searching...
- hash (Unix)Hash (Unix)hash is a Unix command that prints the location information for the commands found.-Description:When the user gives a command, the shell searches for the command in the path specified in the PATH environmental variable and stores the location in the hash. This command can be used to search for the...