O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

type — stdin  stdout  - file  -- opt  --help  --version

Synopsis

type [options] commands

The type command, like which, locates an executable file in your shell’s search path:

$ type grep who
grep is /bin/grep
who is /usr/bin/who

However, type is built into the bash shell, whereas which is a program on disk:

$ type which type rm if
which is /usr/bin/which
type is a shell builtin
rm is aliased to `/bin/rm -i'
if is a shell keyword

As a built-in command, type is faster than which; however, it’s available only if you’re running bash.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required