type Command in Linux | Explained

The “type” command line tool is generally used for finding the information of any Linux command. It allows the users to quickly know about the command type, whether it is an “alias”, “keyword”, “shell built-in”, or a “function”. In addition, it also provides the absolute path of the mentioned command by using its supported options.

This guide provides a deep insight into the purpose, working, and usage of the “type” Linux command.

The content of this guide is written below:

Let’s start with the working of the “type” command.

How to Use type Command in Linux?

The generalized syntax of the “type” command is defined below on which it is dependent:


$ type [Options] command names

The above syntax contains the following components:

  • type: Main keyword that represents the “type” command.
  • options: Supported options of “type” command.
  • command names: Specific command names whose type needs to be found with the help of the “type” command.

The “type” command offers a list of important supported options that can easily get through its

help” command:

$ type --help

Scroll down the page to get more pieces of information.

Now, look at the practical implementation of the “type” command using these options.

Example 1: Display Command Type

The “type” command without any argument or options displays the specified command type in a single line as shown in the screenshot:

$ type pwd

The output displays that “pwd is a shell builtin”.

Example 2: Return a Specific Output

The “type” command shows the mentioned file type in a single word with the help of the “-t” option. Suppose execute the “time” command along the “-t” option to get the file type of “ls” utility:

$ type -t ls

The output shows that the “ls” file type is “alias

Run the file “type” command to view the “while” type in Linux:

$ type -t while

The “while” is just a “keyword”.

Similarly, check the type of the “cd(change directory)” command using the “type -t” command:

$ type -t cd

The output displays that “cd” is a “builtin” command line utility.

Type the below command in the terminal to get the type of “cp”:

$ type -t cp

Here, it is verified that “cp” is a “file”.

Example 3: Check the Absolute Path

The “-p” argument of the “type” command provides the absolute path of the specified command. Suppose to check the absolute path of the “mkdir” command, use the “type” command in the following way:

$ type -p mkdir

The output displays the absolute path of “mkdir” that is “/usr/bin/mkdir”.

Example 4: Display all Information of the command

The “-a” flag of the “type” command prints all the information of the Linux command, such as its type and absolute path.

In this example, the “type” command with its “-a” flag is executed to display all the information of the “pwd” command.

$ type -a pwd

Here, the output contains the “pwd” command type “shell built-in” and its absolute path “/usr/bin/pwd”.

It’s all about the basics and workings of Linux’s “type” command.


In Linux, the “type” command tells the type of the specified Linux command in the console. In addition, it also displays the “absolute path” of any Linux command with the help of its unique flags. This guide has demonstrated the main objective, working, and usage of the “type” command with the support of practical examples.