Ad space (banner)
🖥️Linux Lessons
Lesson 58 / 61

Checking a Command's Type with type

type is for when "I want to know whether this command is a shell built-in, or an external program." type determines and displays a given command's category — built-in command, alias, external command, and so on.

Use it in the form type command-name. It's similar to which, but type differs in that it can accurately identify aliases and shell built-ins too.

Running type ls displays what ls actually is — whether it's an executable file, or configured as an alias, for example.

A common early mistake is assuming which and type are the same thing. A command configured as an alias may not display correctly with which.

In real work, this is used for troubleshooting — figuring out the true identity of a command that's behaving unexpectedly because of an alias setting.

Linux
Try it (type this into the pseudo terminal)
type ls

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)