Log in Go to the main page Page Discussion History Go to the file list Go to the site toolbox

Type command

From NetworkCommands


Image:Tux_64x64.png

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

Image:Vm-power-on-medium.png 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

Image:Vm-power-on-medium.png 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

Image:accessories-text-editor-v2-medium.png 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.

Image:utilities-terminal-medium.png 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

Image:accessories-text-editor-v2-medium.png 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


Image:icemon-medium.png Related Commands

The whatis command can be used to display a description of a command's function or purpose.

Image:icemon-medium.png Related Articles

Information on other Linux shell commands Image:Tux-small.png

Information on other Linux commands Image:Tux-small.png

Information on F5 BigIP commands Image:F5-logo-small.png

Information on Cisco commands Image:Cisco-logo-small.png

Information on Vyatta commands Image:Vyatta-logo-small.png

Information on Extreme commands Image:Extreme-logo-small.png

Information on Blue Coat SGOS commands

Information on Nokia IPSO commands


Image:internet-group-chat-small.png We really do appreciate all feedback so please do send your comments, suggestions or corrections to steve#networkstuff.eu (replacing the # with an @)



Site Toolbox:

Personal tools
This page was last modified on 14 August 2008, at 14:06. - This page has been accessed 28 times. - Disclaimers - About NetworkCommands
Powered by MediaWiki