1. Enter the file vim file name (vim test.txt)
2. After editing is completed, press the ESC key to jump to the command mode (the colon in front of the command is necessary ):
:w Save the file but do not exit vi
:w file Save the modifications to the file in addition, without exiting vi
:w! Force save, do not Exit vi
:wq Save the file and exit vi
:wq! Force save the file and exit vi
:q Don’t save the file and exit vi
:q! Do not save the file, force quit vi
:e! Abandon all changes, start editing from the last time you saved the file
PHP Chinese website, there are a lot of freeLinux introduction Tutorial, everyone is welcome to learn!
The above is the detailed content of How to save Linux files. For more information, please follow other related articles on the PHP Chinese website!