Shell commands are worth learning. Here we mainly introduce the Linux shell Command mode, including the shell commands. The Fedora Core Linux is developed in a community-supported way, and the development team of Red Hat Linux will continue to participate in the development of this release. Undo), Linux shell is also called a recovery command, which is a very useful command that can cancel the impact of previous misoperations or inappropriate operations on files, it is returned to the status before this misoperation or inappropriate operation is executed.
Undo the previous command)
The preceding command can be canceled in two forms. In command mode, the Linux shell Type the u and U characters. Their functions are to cancel the command just entered and restore to the original situation. The lower-case u and upper-case U have different details. The difference between the two is that the upper-case U command is used to restore the case before the misoperation command, that is, if you use the U command after the command is inserted, delete the content you just inserted. If you use the U command after the DELETE command, it is equivalent to inserting the content you just deleted at the cursor. All commands for modifying text are considered as insert commands. That is to say, the U command can only cancel the previous step. If the U command is used to cancel the previous step, when you press the U key again, it is not to cancel the previous step, instead, the operation just executed by the U command is revoked, that is, the State is restored to the previous state before the first U command is used. The result is that nothing is done. The lower-case u command restores the current row to the status before editing, regardless of the number of times this row is edited.
The original screen content is:
# Include
Main)
In command mode, Enter command o, insert a new line, enter the content to be inserted, and then press Return to the command mode. The screen displays the following content:
# Include
Main)
Printf "How do you do! ");
If you want to cancel this insert operation, press the command U to restore the screen to the original display.
Note: You can use the cancel command again to cancel the command. In this case, a "negative Positive" effect will be generated, and the file state will be restored to the State before the first command is canceled, as if no operation is performed. For example, in the preceding example, run the "U" command again to display the inserted content on the screen.
Redo)
Repeated commands are also very common commands. In text editing, Linux shell often encounters repeated operations, which requires repeated commands. It allows you to easily execute a complex command just completed. Repeated commands can only work in command mode. In this mode, press the "." key. When executing a duplicate command, the result depends on the current position of the cursor.
The displayed content is:
# Include
Main)
Enter command o, enter a line of content, and then <Esc> return to command mode. The displayed content is:
# Include
Main)
Printf "How do you do! ");
Enter the command "." And the displayed content is:
# Include
Main)
Printf "How do you do! ");
Printf "How do you do! ");
Linux shell is an interface between users and Linux operating systems. There are multiple shells in Linux, where Bash is used by default. This chapter describes how shell works, shell types, General shell operations, and Bash features.
- Comprehensive Analysis and Discussion of Linux Shell Programming
- Brief Introduction to the Collection programming language of Linux shell commands
- Linux shell
- Change the output of linux shell
- How to use Linux Shell Variables