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

What is the command to exit vi without saving in centos?

WBOY
WBOYOriginal
2022-02-09 16:49:5714935browse

In centos, the command to exit without saving after vi editing is ":q!"; "q" in this command means leaving vi, and "!" often has a mandatory meaning in vi. If it has been modified If you don't want to save the file, you can use this command to force the file to leave without saving it.

What is the command to exit vi without saving in centos?

The operating environment of this article: centos 6.4 system, Dell G3 computer.

What is the command to exit vi without saving in centos

To edit, first enter the letter i to enter the vim editing state

After editing, press the ESC key to exit the editing state and then Use the ":q" command not to save the file and exit vim or use the ":q!" command not to save the file and force quit vim.

Extension:

:w Save the file without exiting vi

:w file Save the modifications to file without exiting vi

:w ! Force to save and not exit vi

:wq Save the file and exit vi

:wq! Force save the file and exit vi

What is the command to exit vi without saving in centos?

Recommended tutorial: "centos tutorial"

The above is the detailed content of What is the command to exit vi without saving in centos?. 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