1. Text editing
Command mode shortcut key command
|
Command |
Role |
|
Dd |
Delete (cut) the entire line where the cursor is located. |
|
5dd |
Delete (cut) 5 lines starting at the cursor. |
|
Yy |
Copy the entire line where the cursor is located. |
|
5yy |
Copies the 5 lines starting at the cursor. |
|
N |
Displays the next string that the search command navigates to. |
|
N |
Displays the previous string to which the search command is anchored. |
|
U |
Undo action from the previous step |
|
P |
Pastes the previously deleted (DD) or copied (yy) data after the cursor. |
|
? string |
Searches the text for the string from bottom to top. |
|
/String |
Searches for the string from top to bottom in the text. |
Last-line mode shortcut key command
|
Command |
Role |
|
: W |
Save |
|
: Q |
Exit |
|
: q! |
Force quit (Discard modifications to the text) |
|
: wq! |
Force Save exit |
|
: Set Nu |
Show line Numbers |
|
: Set Nonu |
Do not display line numbers |
|
: command |
Execute the command |
|
: integer |
Jump to this line |
|
: S/one/two |
Replaces the first one in the row where the current cursor is located with two |
|
: s/one/two/g |
Replaces all one of the lines in which the current cursor is located |
|
:%s/one/two/g |
Replace all of the one in the full text with the |
Ps:linux Simulator
Linux Script Basics