Home  >  Article  >  Operation and Maintenance  >  How to save modified files in linux

How to save modified files in linux

WBOY
WBOYOriginal
2022-02-25 16:35:0121342browse

How to save modified files in Linux: 1. Use the ":w" command, which is used in conjunction with the vi command to save the modified file without exiting the vi command; 2. Use the ":wq" command , this command means to save the modified file and exit the vi command.

How to save modified files in linux

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

How to save modified files in Linux

Edit mode

After using vi to enter the text, press i to start editing the text

Exit edit mode

Press the ESC key, then:

Exit vi

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

:w Save the file without exiting the vi command

:wq Save the file without exiting the vi command

When interrupting vi mode, then enter vi to save the error:

If you do not need to save the last edited content, delete the temporary file directly: rm .my.cnf.swp

(Then the system prompts whether to confirm the deletion: rm: remove regular file `.my.cnf.swp' ?)

Enter y directly and press Enter, as shown in the figure below

How to save modified files in linux

Related recommendations: "Linux Video Tutorial"

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