VI is a Linux terminal or console under the Common editor, the basic mode of operation is: VI/path/file name
For example, Vi/etc/fstab indicates that the contents of the/etc/fstab file are displayed. Use the page UP and PAGE DOWN keys on your keyboard to page up and down, press the INSERT key to see the word "insert" in the lower-left corner of the window to indicate that you are currently inserting an edit state, and then insert the contents from the keyboard into the cursor position, and then press the INSERT key and the lower left corner will have " Replace word, which means that the contents of the cursor position are replaced by the content entered from the keyboard when the edit state is currently replaced. When you are finished editing the content, press ESC and enter ": Wq" and then enter to save the exit.
If you do not want to save and exit directly, press the ESC key, enter ": q!", and then return. "Wq" means write and quit, that is, save exit; " q! " Indicates that the modify forced exit is ignored.
How to edit and save files with VI under Linux