The shell itself is a program written in C, which is a bridge for users to use Unix/linux, and most of their work is done through the shell. The shell is both a command language and a programming language. As a command language, it interprets and executes user-entered commands interactively, and as a programming language, it defines variables and parameters and provides many control structures in high-level languages, including loops and branches.
Although it is not part of the Unix/linux system kernel, it invokes most of the functionality of the system core to execute programs, create files, and coordinate the operation of individual programs in a parallel way. Therefore, for the user, the shell is the most important utility program, in-depth understanding and proficiency in the shell characteristics of the extremely use of the method is the key to good unix/linux system.
It can be said that the proficiency of the shell is a reflection of the user's proficiency in the use of unix/linux.
Note: There is no point in learning the Shell alone, please refer to the Unix/linux Getting Started tutorial to learn Unix/linux basics.
The shell has two ways of executing commands:
- Interactive (Interactive): Explains the execution of a user's command, the user enters a command, and the shell interprets the execution of a single rule.
- Batch: The user writes a shell script in advance, with a number of commands that allow the shell to execute the commands at once without having to hit the command one at a time.
Shell scripts are similar to programming languages, and there are variables and process control statements, but shell scripts are interpreted and do not need to be compiled, and the shell program reads and executes the commands from a single line of script, which is equivalent to a user knocking a line of commands from the script to the shell prompt for execution.
For Shell Beginners Please note that in a normal application, it is not recommended to run the shell with the root account. As a normal user, no matter whether you intentionally or unintentionally, can not destroy the system, but if it is root, it is different, as long as a few letters, can lead to disastrous consequences.
"Go" shell Tutorial--01 Shell Introduction: What is the two ways to execute the Shell,shell command