In
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s,
type
is a
command
Command may refer to:
Computing
* Command (computing), a statement in a computer language
* COMMAND.COM, the default operating system shell and command-line interpreter for DOS
* Command key, a modifier key on Apple Macintosh computer keyboards
...
that describes how its
arguments
An argument is a statement or group of statements called premises intended to determine the degree of truth or acceptability of another statement called conclusion. Arguments can be studied from three main perspectives: the logical, the dialectic ...
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-in
* function
*
alias
*
hashed command
* keyword
The command returns a non-zero
exit status
The exit status of a process in computer programming is a small number passed from a child process (or callee) to a parent process (or caller) when it has finished executing a specific procedure or delegated task. In DOS, this may be referre ...
if command names cannot be found.
Examples
$ type test
test is a shell builtin
$ type cp
cp is /bin/cp
$ type unknown
unknown not found
$ type type
type is a shell builtin
History
The
type
command was a
shell builtin
In 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.
Shell builtins work significantly f ...
for
Bourne shell
The Bourne shell (sh) is a shell command-line interpreter for computer operating systems.
The Bourne shell was the default shell for Version 7 Unix. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic link ...
that was introduced in
AT&T's System V Release 2 (SVR2) in 1984, and continues to be included in many other POSIX-compatible shells such as
Bash. However,
type
is not part of the
POSIX standard. With a POSIX shell, similar behavior is retrieved with
command -V name
In the
KornShell
KornShell (ksh) is a Unix shell which was developed by David Korn at Bell Labs in the early 1980s and announced at USENIX on July 14, 1983. The initial development was based on Bourne shell source code. Other early contributors were Bell ...
, the command
whence
provides similar functionality.
The command is available as a separate package for
Microsoft Windows as part of the
UnxUtils
UnxUtils is a collection of ports of common GNU Unix-like utilities to native Win32, with executables only depending on the Microsoft C- runtime msvcrt.dll. The collection was last updated externally on April 15, 2003, by Karl M. Syring. ...
collection of
native
Native may refer to:
People
* Jus soli, citizenship by right of birth
* Indigenous peoples, peoples with a set of specific rights based on their historical ties to a particular territory
** Native Americans (disambiguation)
In arts and enterta ...
Win32
The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations ...
ports
A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as Ha ...
of common
GNU
GNU () is an extensive collection of free software
Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any ...
Unix-like utilities.
Native Win32 ports of some GNU utilities
/ref>
See also
* List of Unix commands
This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems.
List
See also
* List of G ...
* which (command)
In computing, which is a command for various operating systems used to identify the location of executables. The command is available in Unix and Unix-like systems, the AROS shell, for FreeDOS and for Microsoft Windows. The functionality of the ...
* hash (Unix)
hash is a command on Unix and Unix-like operating systems that prints the location information for the commands found. The command has also been ported to the IBM i operating system.
Syntax
$ hash ame Description
When the user gives a command, ...
References
Standard Unix programs
Unix SUS2008 utilities
IBM i Qshell commands
{{operating-system-stub