Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

type - write a description of command type

&pagelevel(4)&pagelevel

The POSIX shell built-in type is used to indicate how the shell would interpret a given name if it were entered as a command. The command type (and some other information) is written to standard output.

In the POSIX shell sh, type is an exported alias for whence -v; whence is a POSIX shell built-in command.


Syntax


type name ...

name

Name of the command whose type is to be queried. Several blank-separated names may be specified at a time.

If name is neither a shell function nor a POSIX shell built-in, the shell searches for an executable file with this name in the directories whose path names are defined in the PATH variable.

The type command indicates whether name is a shell function or a POSIX shell built-in. If name designates an executable file, the absolute path name or a path name in the form ./name is displayed.

If name is a shell function, type will additionally print the function definition. In the POSIX shell, the definition is not shown.

If name is not an executable file, type issues an error message. The same error message is also output if name does not exist in the directories whose path names are assigned to the PATH variable.

Error

name not found

This error message means:

  • either there is no file with this name in the directories that can be accessed via the PATH variable

  • or the file with this name is not executable.

Variable

PATH

Determine the location of name.

Locale

The following environment variables affect the execution of type:

LANG

Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL

If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE

Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files), the classification of characters as upper- to lower-case, and the mapping of characters from one case to the other.

LC_MESSAGES

Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

NLSPATH

Determine the location of message catalogs for the processing of LC_MESSAGES.

Example

The following series of commands illustrates the kind of information supplied by the shell built-in type:

$ type mount
mount is /etc/mount

$ type echo

echo is a shell builtin

$ type ls

ls is a tracked alias for /usr/bin/ls

$ type typetest
typetest is ./typetest

See also

whence, file