Back to the command reference

type

HelpFundamentals In simulator In real Linux

Tell what a command name is: builtin, alias or program

Name: type

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

type is a shell builtin that tells how the shell would interpret a name: alias, keyword, function, builtin or a program in PATH. It is more accurate than which, which only searches PATH and can't see aliases or builtins.

Syntax

type NAME...

Common options

-aShow every match
-tOnly the kind: alias, keyword, function, builtin or file
-pOnly the path of the executable

Examples

  • $ type cd

    cd is a shell builtin

    Explain
  • $ type ls

    Shows where the ls program lives

    Explain

Related