Name

type

Synopsis

type [-afpPt] commands

Show whether each command name is a Linux command, a built-in command, an alias, a shell keyword, or a defined shell function.

Options

-a

Print all locations in $PATH that include command, including aliases and functions. Use -p together with -a to suppress aliases and functions.

-f

Suppress function lookup, as with command.

-p

If type -t would print file for a given command, this option prints the full pathname for the executable files. Otherwise, it prints nothing.

-P

Like -p, but force a PATH search, even if type -t would not print file.

-t

Print a word describing each command. The word is one of alias, builtin, file, function, or keyword, depending upon the type of each command.

Example

$ type mv read if
mv is /bin/mv
read is a shell builtin
if is a shell keyword

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.