The command types are in the Linux system

by Daniel Pham
Published: Updated:
This entry is part 1 of 9 in the series Linux commands: Part 5 - Working with commands

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.

executable programs in /usr/bin directory
Executable programs in /usr/bin directory.

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.10

Instead, 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_influx

Conclusion

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).

0 0 votes
Article Rating
Series NavigationNext part: Type command to display a command’s type »»

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

2
0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.