The commands for vim to exit without saving in Linux are: ":q" and ":q!". ":q" means to exit vim without saving, ":q!" means to forcefully exit vim without saving, "!" means that vim performs a forced operation.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
The command to exit vim without saving in linux
:q -Exit vim without saving the file
:q! -Forcibly exit vim without saving the file
The example is as follows:
:w - Save the file without exiting vim
:w file - Save the changes to file in addition in, do not exit vim
:w! - force save, do not exit vim
:wq - save the file, exit vim
:wq! -Force to save the file and exit vim
:e! -Abandon all changes and start editing from the last time you saved the file
Examples are as follows:
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What is the command to exit vim without saving in Linux?. For more information, please follow other related articles on the PHP Chinese website!