shell and bash in linux operating system

Table of contents

Shell commands and operating principles

Why can't I use the kernel directly?

In general:


Shell commands and operating principles

Strictly speaking, Linux is an operating system, called "kernel " , but we ordinary users cannot use the kernel directly. Instead, it communicates with the kernel through the kernel's "shell" program, the so-called shell .

Why can't I use the kernel directly?

1. Execute commands and programs: Through Shell, users can directly enter commands and perform various operations, such as running programs, managing files, configuring systems, etc. Shell accepts user input, interprets and executes corresponding commands or programs.
2. Scripting and automation : Shell provides the ability to write scripts, which can combine multiple commands together to form a script file. Scripts can be used for automated tasks, batch operations, system management, etc. Users can write scripts to perform a series of actions, reducing the amount of manual work required.
3. System configuration and management : Shell provides the function of managing system configuration and resources. Users can use Shell to modify system settings, install software, manage users and permissions, etc. Through the command line interface, system administrators can quickly and flexibly complete various system management tasks.
4. Powerful command line tools : Linux provides a rich set of command line tools, such as grep, awk, sed, etc. These tools can be called and combined through Shell. Shell provides functions such as pipes and redirection, allowing users to easily process and redirect command output.
5. Programmability and scalability : Shell itself is a scripting language and supports basic programming structures such as variables, conditional statements, and loops. Users can write complex scripts to implement customized functions and extensions. In addition, you can extend the functionality of the Shell by creating custom commands, functions, and aliases.

From a technical perspective, the simplest definition of Shell: command interpreter (command Interpreter)

Main function: Translate user commands to the kernel for processing. At the same time, the core processing results are translated to the user.

In general:

Compared with the Windows GUI, when we operate Windows, we do not directly operate the Windows kernel, but click through the graphical interface to complete our operations (for example, to enter the D drive, we usually double-click the D drive letter or run an application) .

The shell has the same function for Linux, mainly parsing our instructions and parsing the instructions to the Linux kernel. The feedback results are run through the kernel and parsed to the user through the shell.

Guess you like

Origin blog.csdn.net/m0_74234485/article/details/132527597