Vi editor operation method - exit, save, save as

Some commonly used commands, the black part of the command is more important:

oEnter the editing mode,
after editing,
press the ESC key to switch to the command mode, and then enter the following commands to perform corresponding operations:

:w save the file without exiting vi editor

:w! Forced to save without exiting vi editor

:w file Save the modification to file without exiting vi editing

:wq save the file and exit vi editor

:wq! Force to save the file and exit vi editor

:q do not save the file and quit vi editing

:q! Do not save the file and force quit vi editing

:e! Discard all modifications and start editing from the last saved file

Guess you like

Origin blog.csdn.net/qq_41320433/article/details/126606982