Table of Contents
In Linux, how many types of commands? What are the Linux command types? This article, we will learn about it.
Currently there are many different operating systems, many different programs, many different programming languages. But in general, the Linux command will fall into one of the following four types.
An executable program
If you have read the article about script file location and execute script before. You should see that I mentioned the /usr/bin directory. This is one of the directories that contain executable files that the operating system will automatically search for files in and execute those files.
These executable files, we call them executable programs, can be written in different programming languages such as C, C ++, shell, Perl, Python, Ruby, etc.

A command built into the shell itself
Bash itself, also supports a number of commands called shell builtins.
According to the definition from Wikipedia, a shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute.
For example, cd command is a shell builtin.
A shell function
These are small scripts that are integrated into the execution environment. Saying that seems a bit confusing, imagine that you have a great program.
Recommended Reading: Understand system directories on Linux systems
In that big program, you divided into 10 small features. Each of these small features writes in a small script file and does not grant execution permissions.
When the large program executes, it will call or import the other small scripts into it. Something like that, there will be other articles I talk about.
An alias
This is an interesting command. Thanks to it, I can solve a lot of simpler things.
The alias statement is actually a mapping statement. It is simply defined to essentially call and execute a program or another command.
I will show the following example, when working with InfluxDB, every time I want to login, I will enter a long paragraph like this.
influx -ssl -unsafeSsl -host 192.168.10.10Instead, I defined an alias in my user environment called login_influx. From there, instead of having to type long commands above, I just need to type login_influx to successfully login to the InfluxDB command line.
echo "alias login_influx='influx -ssl -unsafeSsl -host 192.168.10.10'" >> ~/.bashrc
source ~/.bashrc
login_influxConclusion
By the way, you know the types of commands available in the Linux operating system. The next article, we will learn the commands to help you determine the type of command.
(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).