Open the host file with the VIM command
[Email protected]/]# vim/etc/hosts
Press "I" key to enter edit mode
Press "ESC" key to exit Edit mode
Press "Backspace" key to delete the previous character of the cursor
Press "Delete" key to delete one character after the cursor
Press "DD" key to delete the forward
Press "YY" key to copy the forward
Press "P" key to paste the copied content to the next line
Press ": Wq" to save exit
Press ": X" to save the exit
Press ": q!", Force quit do not save
Up key: Move the cursor to the previous line
"Down" key: Move the cursor to the next line
Left key: Moves the cursor to the left one character
"Right" key: Move the cursor to the right to move one character
"Home" key to move the cursor to the beginning of the current
"End" key, the cursor has been at the end of the current line
"PgUp", PAGE Up
"PgDn", PAGE Down
[The END]
The vim command edits the base command of the host file: