Home  >  Article  >  Operation and Maintenance  >  What is the command to exit vim without saving in Linux?

What is the command to exit vim without saving in Linux?

WBOY
WBOYOriginal
2022-04-07 15:23:3123530browse

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.

What is the command to exit vim without saving in Linux?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What is the command to exit vim without saving in linux

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:

What is the command to exit vim without saving in Linux?

  • :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:

What is the command to exit vim without saving in Linux?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn