Skip to content

The type command

The type command tells you what a command name runs: an alias…

The type command tells you what a command name runs: an alias, a command built into the shell, or a program and where it lives.

A practice shell in your browser that behaves like bash on Linux for these commands. Nothing you type leaves the page.

Usage

type [-t] NAME...

Say what a command name runs: an alias, a builtin or a program. Tells you how the shell would run each name: an alias (and what it stands for), a shell keyword such as if, a function, a command built into the shell, such as cd, or a program on disk, with its path. Unlike which, it knows about aliases, functions and builtins.

How to use type

Check a name

type ll
ll is aliased to `ls -alF'
type cd
cd is a shell builtin
type grep
grep is /usr/bin/grep

Options

-tone word: alias, keyword, function, builtin or file

More examples

type ls
Ls is /usr/bin/ls
ls is /usr/bin/ls

Questions about type

What is the difference between type and which?

which looks only for programs in your PATH. type also knows aliases and shell builtins, so it tells you what the shell will really run.

Every everyday command on one page, to print or keep open: the Linux commands cheat sheet.