Course connection: Basic command line BASH operations
Shell
1. Shell is an intermediary between the user and the underlying operating system (usually the kernel). It is responsible for transmitting user commands and operations to the underlying operating system.
2. There are two types of Shell: CLI and GUICLI: Command Line Interface-Command Line Shell (Linux) GUI: Command Line Interface-graphical Shell (Mac, Windos default Management Mode) in Linux, the default GUI is GNOME and CLI is BASH.
BASH
1. Prompt: # root user (root) $ normal user <username >@< Host Name> <working directory>
2. commands: commands, options, and parameters.
3. Tab key completion:
- Automatic completion command
- Automatically complete file name
- Unable to complete Parameters
You can view possible commands or file names that may be supplemented by two consecutive times.
4. History
- Use the up/down key to view historical commands
- Use the history command to view
Simplified Method for calling History commands :!! Repeat the previous command! <Character> repeat the previous command starting with "character! <Value> execute the command according to the sequence number of the history record !? <String> repeat the command that previously contains "string! -<Value> repeat the commands before the "value" command
Ctrl + r History Search
Esc +. Call the parameters of the previous command
5. Is the wildcard * zero or multiple characters? Match a character [<several numbers>] to match a number in the range of "several numbers" [<several characters>] to match a letter in the "several characters" [^ <several characters>] match characters other than the list
6. Switch user su-<User Name> (root by default)
- Su-started a new terminal
- Su only switches users
- Sudo + <cmd> run commands with administrator privileges
- Id to obtain information about the current user
- Passwd: change the current user password
7. Job Management
- <Cmd> + & place commands in the background
- Jobs
- Bg + <No.> continue to execute a background task
- Fg + <No.> move a background task to the foreground
This command