The command types are in the Linux system

Share this post to your friends !

This entry is part 1 of 9 in the series Linux commands: Part 5 - Working with commands

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

the-command-types-are-in-the-linux-system The command types are in the Linux system
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.

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

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'" >> ~/.bashrc
# source ~/.bashrc
# login_influx


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.

Continue reading the seriesNext part: Type command to display a command’s type »»
If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.

Share this post to your friends !
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

single post bottom banner
«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.