Home  >  Article  >  Operation and Maintenance  >  How to save files edited by vi in ​​linux

How to save files edited by vi in ​​linux

尚
Original
2020-03-27 16:45:265168browse

How to save files edited by vi in ​​linux

After editing in vi, first press the ESC key to return to the 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 without exiting vi

:w file Save the modifications to file without exiting vi

:w! Force save without exiting vi

:wq Save the file and exit vi

:wq! Force save the file without exiting vi

:q Do not save the file , exit vi

:q! Do not save the file, force exit vi

:e! Abandon all modifications

Recommended learning: Linux video tutorial

The above is the detailed content of How to save files edited by vi 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