Before giving you a detailed introduction to LINUX Bash, let us know how to edit the command line, and then introduce LINUX Bash in detail, hoping to be useful to you. In LINUX Bash, you can edit the command line so that you can modify the command you typed before executing the command you typed.
Edit command line
In LINUX Bash, you can edit the command line so that you can modify the command you typed before executing the command you typed. If a spelling error occurs when you type a command, you only need to use the edit command to correct the editing error before running the command, and then run it without re-entering the entire command line. This function is particularly useful for commands that use a long path file name as a parameter.
Table 10-2 is a summary of the command line editing operation. Table 10-2 command line editing
LINUX Bash command line editing
Function
Ctrl + B or the left arrow to move one character to the previous one)
Ctrl + f or right arrow to move one character to the next one)
Ctrl + a move to the beginning of the line
Ctrl + e move to the end of the row
Esc B shifts one word to the left.
Esc f shifts one word to the right.
Del: Delete the character at the cursor
Ctrl + d Delete the character at the cursor
BACKSPACE or Ctrl + h Delete the character on the left of the cursor
Ctrl + k Delete to end of line
Command history
In LINUX Bash, The history command can save the recently executed command. The history number of these commands starts from 1, and only a limited number of commands can be saved, up to 500, that is, the default history Number of the history command is 500. To view the most recently executed commands, just type the history command and enter the Enter key. The recently executed commands are displayed in sequence with the number before each command as the history number ).
$ History
1 cp mydata today
2 vi mydata
3 mv mydata reports
4 cd reports
5 ls
All these LINUX Bash commands are called event). An event indicates that an operation has occurred, that is, a command has been executed. These events are identified by numbers in the order they are executed. This identifier is called a historical event number. The event number of the last historical event is the maximum. Each event can be determined by its historical event number, initial character of the command, or string.
- Why does Microsoft envy Linux system security?
- Parsing Linux OS modification time
- Comprehensive parsing of Linux Make rules
- Required Linux shutdown/restart command
- Allows you to use the Linux operating system to accelerate remote logon.