Home  >  Article  >  Operation and Maintenance  >  What is the command to save the edit without exiting in Linux?

What is the command to save the edit without exiting in Linux?

WBOY
WBOYOriginal
2022-04-12 15:52:196084browse

Commands to save without exiting: 1. ":w" command, which can save the edited data without exiting vim; 2. ":w!" command, which can force saving of edited data data without exiting vim; 3. ":w file name" command, this command can save the edited data in the specified file without exiting vim.

What is the command to save the edit without exiting in Linux?

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

What is the command to edit and save without exiting in Linux

  • :w - Save the file without exiting vim, and write the edited data to the hard disk file (commonly used)

  • :w file - Save the modifications to file separately, without exiting vim, and save the edited data into another file (similar to saving a new file)

  • :w! - Force saving without exiting vim. If the file attribute is "read-only", the file will be forced to be written. However, whether you can write it or not depends on your file permissions on the file!

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 but do not exit vi

:w file Save the changes separately to file, do not exit vi

:w! Force save, do not exit vi

:wq Save the file and exit vi

:wq! Force to save the file and exit vi

:q Do not save the file and exit vi

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

:e! Abandon all changes, start editing from the last time you saved the file

What is the command to save the edit without exiting in Linux?

【Related recommendations: laravel video tutorial

The above is the detailed content of What is the command to save the edit without exiting 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