What is a shell?
The shell is the user interface of the system, which provides an interface (command parser) that the user interacts with the kernel, and the shell receives the user's input command and sends it to the kernel for execution, such as
Shell's function
The most important function of the shell is command interpretation, and all executables in the Linux system can be executed as shell commands. To classify an executable file as a
- Linux commands: Commands stored in the/bin,/sbin directories
- Built-in commands: For efficiency reasons, some common commands are constructed inside the shell
- Utility: Utilities or tools stored in directories such as/usr/bin,/usr/sbin,/usr/share,/usr/local/bin, etc.
- User program: After compiling the executable file, the user program can also be run as a shell command
- Shell script: A batch file written by the shell language
Parsing process
Rhel/centos The default shell is bash, and there are other shells, such as bsh,ksh,csh
Shell Meta-characters
The wildcard character of a shell
Escape character of the shell
Command format for Shell
1 # cmd [-options] [arguments]
Where CMD is the command; options is an option; arguments is a parameter, that is, the action object
PS: Single character parameter use-, Word parameter use--
Hint: "*" can match "." In the file or directory name, but cannot match the first character is "." The file or directory name. The ". *" should be used to match the implied file.
Shell and Command Basics