Getting started with Linux: Understanding shell and bash
I. shell
The direct controller of computer hardware is the kernel of the operating system. Because of the importance of the kernel, as a user, we cannot directly operate the kernel, therefore, we need shell to call the application or double-click to open the installed application to communicate with the kernel. Shell is equivalent to an interface that connects the program to the kernel. or shell is a desk that provides the necessary office environment for the worker.
Most of today's shells are in the form of command line interfaces. Different operating systems have different shells. Linux uses bash by default.
Because shell is an interface with the kernel, you can control user operation permissions by not giving some user shells, such as/sbin/nologin in/etc/shells. After the user logs on to the terminal, in Linux, a shell is assigned to the user based on the setting of the/etc/passwd file. If the user's shell is assigned as/sbin/nologin (default:/bin/bash) the user cannot log on.
Ii. bash
Bash features advantages:
1. history
Command memory: Record commands that have been executed. After logging out of the system, this operation record is written from memory ~ /. Bash_history. The last operation record can be viewed after the next logon.
2. Press the Tab button to automatically complete the command line
3. alias
Set the alias: alias hsnn = 'LS-al'. Input and execute hsnn. Then, the ls-al command is executed.
4. shell script
Program scripts for easy and convenient System Management
5. Job control, foreground and background control
6. Wildcard (Wildcard)
*_
Iii. built-in bash commands
Bash has many built-in commands: cd umask. You can use the type command to check whether it is a built-in command.
Type-t name
File: External commands
Alias: alias of the command.
Builtin: bash built-in command
When type-p name is an external command, the command path is displayed as which
Type-a name: list all the commands in the PATH that contain name, including alias
Linux Shell script Multithreading
Cat commands use Linux redirection to merge files
Shell programming
Replace Linux Shell Parameters
Shell for parameters
Pass Linux/Unix Shell parameters to SQL scripts
Introduction to parameter passing methods in Shell scripts
PASS command line parameters through Shell scripts
Linux Shell wildcards, escape characters, metacharacters, and special characters
This article permanently updates the link address: