Table of Contents
In this article, we will learn about the type command, the type command used to display a command’s type.
The type command itself is a builtin shell, which can be executed regardless of the other program.
Type command syntax
The syntax of the type command is quite simple, the syntax will look like this:
$ type commandHere, we’ll try some examples.

~ $ type type
type is a shell builtin
~ $ type cp
cp is /bin/cp
~ $ type ls
ls is aliased to `ls --color=auto'The result of the type of commands seems different. According to the previous article, we have about 4 types of commands.
Now that you can see, the type command returns type is a shell builtin, which is the builtin type.
The cp command returns the result cp is /bin/cp, which is the type of executable program.
As for ls, the result is ls is aliased to `ls --color=auto', you might wonder why it is alias. Do you notice that when you type the ls command, the files and folders have different colors, thanks to the --color option.
The ls command on different operating systems may have different aliases. For example, in Linux Mint, alias is ls --color=auto. The ls command in Fedora, alias is ls --color=tty.
Conclustion
The type command may be useful in some cases. For example, you need to know that command is using which executable file or which file to link to.
(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).