Session and utilities

The type command

Says what a name is: a binary, a shell builtin or an alias. It answers 'why does this command behave like this'.

Syntax

type nombre

Most useful options

-aShows all matches
-tOnly the type (file, builtin, alias)

Copy-ready examples

$ type lsWhat is ls?
$ type cdAnd cd?

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • An alias can hide the real command: type reveals it.

Related commands

FAQ

Difference from which?

which only searches the PATH; type also recognises builtins and aliases.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course