Linux system boot into desktop system with Init5vim Editor installed Yum--disablerepo=\*--enablerepo=c6-media install man vim-y
Copy passwd to current directory
Command modeH left J down K Upper L Right Capital H current screen at the very beginningg at the very end of the current screenm the middle of the current screenIf you want to jump to a row can use NG but the number can not use the keypad to copy a line with the keyboard above the letter YY cursor in which row is the copy of the row is copied multi-line nyy 2yy copy cursor in the line and the next line paste P undo u Delete one line dd Delete multi-line NDD Delete a word Character X is deleted directly from the cursor position to the end of line D to save the exit uppercase ZZInsert Modevim passwd after direct: Set Nu to display line numbersLowercase a directly to the right of the cursor's current position INSERT into insert mode Capital a jumps directly to the end of the line to insert a mode lowercase i in the current position of the cursor to implement the insertion of uppercase I at the beginning of the line implementation of inserting lowercase o on the next line of the cursor to create a new row implementation insert uppercase O in the current line of the cursor There is an insert when it appears that the command mode is now in the bottom row mode-"Bottom line mode: Display line number: Set NU does not display line number: Set nonu/down search lowercase n means move cursor down, in your selected text (same direction) uppercase N means move the cursor up, Within the text you selected (in the opposite direction)? Search up the Vegetarian
lowercase n means the same direction, up
uppercase n indicates the opposite direction, downwardFind ReplacementsThe cursor moves to that line and then directly: s/the old string/new string, you can modify the first string of that line s/oldstring/newstring replace all the strings in that line s/oldstring/newstring/g
Line number 1, line number 2s/oldstring/newstring/g1,$s/oldstring/newstring/g,$ represents the end, replace all
Line number, +n s/oldstring/newstring/g number of lines below the line count, N-s/oldstring/newstring/g rows above a few rows save W exit Q Wq wq! Q! Add! Represents the force exit special function 1. Instruction input as the contents of the file command mode!! Add command
2. Read the contents of other files Yum--disablerepo=\*--enablerepo=c6-media install dhcp-y
Install package yum--disablerepo=\*--enablerepo=c6-media install dhcp-y
Open file in bottom row mode: R/usr/share/doc/dhcp*/dhcpd.conf.sample save part of the file 8,9 w/root/f1.txt
You can see F1.txt: line number 1, line number 2 w>>/root/f1.txt
: 21,22 w>>/root/f1.txt >> = Append
: 14,15 w! /root/f1.txt directly overwrite F1.txt file
From for notes (Wiz)
Vim Editor, Command mode, insert mode, bottom line mode