# Type (Unix)

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Type_(Unix)
> Markdown URL: https://mediated.wiki/source/Type_(Unix).md
> Source: https://en.wikipedia.org/wiki/Type_(Unix)
> Source revision: 1353609441
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Unix command}}
{{Lowercase title}}
{{distinguish|TYPE (DOS command)}}
{{Infobox software
| name                   = type
| logo                   = 
| screenshot             = Type command example.png
| screenshot size        = 
| caption                = Examples of <code>type</code> command
| author                 = [AT&T Corporation](/source/AT%26T_Corporation)
| developer              = Various [open-source](/source/open-source_software) and [commercial](/source/commercial_software) developers
| released               = {{Start date and age|1984}}
| latest release version = 
| latest release date    = 
| operating system       = [Unix](/source/Unix) and [Unix-like](/source/Unix-like)
| platform               = [Cross-platform](/source/Cross-platform)
| genre                  = [Command](/source/Command_(computing))
| license                = 
| website                = 
}}
In [Unix](/source/Unix) and [Unix-like](/source/Unix-like) [operating system](/source/operating_system)s, '''<code>type</code>''' is a [command](/source/command_(computing)) that describes how its [arguments](/source/command-line_argument) would be interpreted if used as command names.

==Function==
Where applicable, <code>type</code> will display the command name's path.<ref>{{Cite web |date=2020-05-11 |title=Use Type Command in Linux to Get More Info About Commands |url=https://linuxhandbook.com/type-command/ |access-date=2025-02-09 |website=Linux Handbook |language=en}}</ref><ref>{{Cite web |date=2019-05-06 |title=type command in Linux with Examples |url=https://www.geeksforgeeks.org/type-command-in-linux-with-examples/ |access-date=2025-02-09 |website=GeeksforGeeks |language=en-US |archive-date=2025-03-04 |archive-url=https://web.archive.org/web/20250304091600/https://www.geeksforgeeks.org/type-command-in-linux-with-examples/ |url-status=live }}</ref> Possible command types are:
* [shell built-in](/source/Shell_builtin)
* function
* [alias](/source/alias_(command))
* [hashed command](/source/hash_(Unix))
* keyword

The command returns a non-zero [exit status](/source/exit_status) if command names cannot be found.

===Examples===
<syntaxhighlight lang="console">
$ 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
</syntaxhighlight>

==History==
The <code>type</code> command was a [shell builtin](/source/shell_builtin) for [Bourne shell](/source/Bourne_shell) that was introduced in [AT&T's System V Release 2 (SVR2)](/source/SVR2) in 1984,<ref>{{Cite web|url=https://www.in-ulm.de/~mascheck/bourne/index.html|title=traditional Bourne shell family / history and development|website=www.in-ulm.de|access-date=2018-10-07|archive-date=2004-02-03|archive-url=https://web.archive.org/web/20040203204407/https://www.in-ulm.de/~mascheck/bourne/index.html|url-status=live}}</ref> and continues to be included in many other POSIX-compatible shells such as [Bash](/source/Bash_(Unix_shell)). However, <code>type</code> is not part of the [POSIX standard](/source/POSIX). With a POSIX shell, similar behavior is retrieved with
 command -V name

In the [KornShell](/source/KornShell), the command <code>whence</code> provides similar functionality.<ref>
{{cite book|url=https://books.google.com/books?id=WQPQEbGx73EC|title=Linux in a Nutshell|last1=Siever|first1=Ellen|publisher=O'Reilly Media, Inc.|isbn=9780596009304|series=Nutshell handbooks|date=27 July 2005 |publication-date=2005|page=695|quote=whence [...] Korn shell only. Show whether each command is a Unix command, a built-in command, a defined shell function, or an alias.|access-date=2016-07-05}}
</ref>

The command is available as a separate package for [Microsoft Windows](/source/Microsoft_Windows) as part of the [UnxUtils](/source/UnxUtils) collection of [native](/source/Native_(computing)) [Win32](/source/Windows_API) [ports](/source/porting) of common [GNU](/source/GNU) Unix-like utilities.<ref>{{Cite web |url=https://unxutils.sourceforge.net/ |title=Native Win32 ports of some GNU utilities |access-date=2026-02-03 |archive-date=2006-02-09 |archive-url=https://web.archive.org/web/20060209022842/http://unxutils.sourceforge.net/ |url-status=live }}</ref>

==See also==
{{Wikibooks|Guide to Unix|Commands}}
* [List of Unix commands](/source/List_of_Unix_commands)
* [which (command)](/source/which_(command))
* [hash (Unix)](/source/hash_(Unix))

==References==
{{Reflist}}

{{Unix commands}}

Category:Standard Unix programs
Category:Unix SUS2008 utilities
Category:IBM i Qshell commands

{{operating-system-stub}}

---
Adapted from the Wikipedia article [Type (Unix)](https://en.wikipedia.org/wiki/Type_(Unix)) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Type_(Unix)?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
