Type command
From NetworkCommands
A command shell built-in function available on Linux platforms; used to display how a command name (or names) would be interpreted if entered as a command.
Contents |
Usage Syntax
type [options] command-name [command-name...]
Common options include;
- -t - display the form command-name takes, either: alias, keyword, function, builtin, or file. If command-name is an alias, also display what kind of alias: shell, reserved word, function, builtin, or disk file
- -p - display the disk file that would be executed if command-name was entered as a command, if there is one
- -P - perform a path search for command-name
- -a - display all executables with command-name. Aliases and shell functions are also shown as long as -p is not used
- -f - do not lookup command shell built-in functions/commands
Usage Examples
type clear - display how the clear command would be interpreted if entered as a command
type -t clear - display what form the clear command takes
Usage Notes
If the command-name is not found, nothing is displayed.
-p will only display output if command-name is a disk file (such as /usr/bin/clear for the clear command)
If a command is hashed -p and -P will only display the hashed value, not the file that first appears in PATH
Hashed means the command's path is saved, negating the need for the system to search for the command.
Typical Output
type clear;
clear is hashed (/usr/bin/clear)
type -t clear;
file
type -p clear;
/usr/bin/clear
type echo;
echo is a shell builtin
Linux Usage Notes
With most Linux or Unix commands;
- Brief help can be displayed using the option/keyword: -h or --help, for example: chmod --help
- A full command manual can be displayed using the man command followed by the command name, for example: man chmod
- Sometimes 'info' pages are used instead of or to provide more information than man pages; for example: info chmod
- Version information can be display using the option/keyword: -v or --version, for example: chmod --version
Related Commands
The whatis command can be used to display a description of a command's function or purpose.
Related Articles
Information on other Linux shell commands
Information on other Linux commands
Information on F5 BigIP commands
Information on Cisco commands
Information on Vyatta commands
Information on Extreme commands
Information on Blue Coat SGOS commands
Information on Nokia IPSO commands







