Commands to save without exiting: 1. ":w" command, which can save the edited data without exiting vim; 2. ":w!" command, which can force saving of edited data data without exiting vim; 3. ":w file name" command, this command can save the edited data in the specified file without exiting vim.
#The operating environment of this article: linux7.3 system, Dell G3 computer.
:w - Save the file without exiting vim, and write the edited data to the hard disk file (commonly used)
:w file - Save the modifications to file separately, without exiting vim, and save the edited data into another file (similar to saving a new file)
:w! - Force saving without exiting vim. If the file attribute is "read-only", the file will be forced to be written. However, whether you can write it or not depends on your file permissions on the file!
Command mode, then enter: w to save, or enter: wq! to save the file and exit.
The following is the save command:
:w
Save the file but do not exit vi
:w file
Save the changes separately to file, do not exit vi
:w!
Force save, do not exit vi
:wq
Save the file and exit vi
:wq!
Force to save the file and exit vi
:q
Do not 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
【Related recommendations: laravel video tutorial】
The above is the detailed content of What is the command to save the edit without exiting in Linux?. For more information, please follow other related articles on the PHP Chinese website!