Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the types of linux instructions

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you what types of relevant knowledge points linux instructions are divided into, detailed content and clear logic. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Linux instructions can be divided into two categories: 1, internal commands, refers to commands integrated within shell, such commands do not need to be installed manually, and automatically run in memory after boot, such as cd, type, echo, time, true, etc.; 2, external commands refer to command toolkits installed through external media, such as yum, rpm, etc.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

Linux is a text-driven operating system, which has the advantage of command interface operation. Compared with the graphical interface, the command interface can save a lot of physical memory space and avoid the dense lists that appear in the graphical interface; at the same time, quite complex operations can be completed in the command interface. Of course, we can also think of the graphical interface as a command-line graphical computing shell.

The important role of the Linux command line

   compared with the graphical interface, the Linux command line is the real core of the Linux system. You can configure the system using the command line. To be proficient and successfully manage the Linux operating system, you must have an in-depth understanding of the Linux command line. The command line under Linux helps beginners understand the operation of the system and the various devices of the computer. For example: central processing unit, memory, disk drive, various input and output devices and user files are all run under Linux system management commands. It can be said that the Linux command line plays a central role in the operation of the whole system and the coordination between devices and files.

Although the trend of   has shifted from the command line to the graphical interface in recent years, and users are also keen on the application of graphical interface, the Linux command line is still the core application in server applications and high-level use. This depends on the better stability and security of the operation under the character interface.

   to sum up, whether it is a beginner of Linux or an authentic Linux old bird, the Linux command line is an indispensable system management tool. It is important to remember that the command line is not just a command, it is a tool, it also needs to be installed.

Classification of commands (instructions)

Linux commands are divided into two categories, internal commands and external commands.

Internal commands: internal commands integrated within shell. Such commands do not need to be installed manually and automatically run in memory after boot. Use the command help to view the details of all internal commands, such as cd, type, echo, time, true, etc.

External commands: command toolkits installed through external media, such as yum, rpm, etc., the specific installation path is under $PATH.

  Note: all internal commands are present in external commands, but only part of them are integrated in shell to increase priority.

Command view: type view command categories, internal commands display shell-related information, external commands display $PATH path

[root@localhost ~] # type timetime is a shell keyword [root@localhost ~] # type datedate is / bin/date

The generation and difference between internal commands and external commands

The shell of CentOs7 is that when bash; is used in Linux, some commands are used more frequently, so it is a waste of time and resources to always read from the hard disk data. So bash integrates these frequently used commands into shell to speed up the call, which is called built-in commands.

So the built-in command is the backup in shell to speed up the invocation of external commands. That is, every built-in command exists on the external command (hard disk).

The difference between the two:

Internal commands are called into memory when the system is started, and are resident in memory, so the execution efficiency is high.

The external command is the software function of the system, and the user only reads the memory from the hard disk when needed.

Command execution order

Single command execution order

Alias- > shell > hash > PATH

Multiple command execution sequence

   Linux multiple command sequential execution connectors (; | | & & |) when we need to execute multiple commands at a time, commands need to be connected with connectors, and different connectors have different effects. Let's make a summary and make a distinction.

(1)

A semicolon, a connector without any logical relationship. When multiple commands are connected with semicolons, the success of each command has no effect on each other, and will be executed one by one.

(2) | |

Logical or, when multiple commands are connected with this connector, the previous command executes successfully, then the subsequent command will not be executed. The previous command will not be executed until the previous command fails.

(3) & &

Logic and, when using this connector to connect multiple commands, the previous command will be executed successfully, the previous command will not be executed, and the subsequent command will not be executed, which is the opposite of |.

(4) |

Pipe character, when multiple commands are connected with this connector, the correct output of the previous command will be handed over to the later command to continue processing. If the previous command fails, it will report an error, and if the later command cannot handle the output of the previous command, it will also report an error.

Example

Ls | grep * .txt

Command priority

Alias > shell built-in > hash > external path

These are all the contents of this article entitled "what are the types of linux instructions?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report