How To Save A File In Linux After Using The Vi Command
Có thể bạn quan tâm
Users who want to save a file in Linux after using the vi command have a few options. To proceed, you may look for the option that best suits your needs, or check out all three.
- Saving a file.
- Saving as another file name.
- Overwriting a read-only file, or a file that already exists.
Saving a file
The command sequence for saving a file in the vi text editor is as follows:
<Esc>:w<Enter>- Pressing Esc exits any editing mode.
- The colon (":") begins command-input mode.
- The lowercase w stands for "write file".
- Pressing Enter executes the write command.
Saving as another file name
To perform a "Save as" operation, writing the text to a new file name, specify the new file name after the w, separated by a space. The command is displayed below.
<Esc>:w file name<Enter>Overwriting a read-only file, or a file that already exists
To save a file marked as read-only, add an exclamation mark ("!") after the w, to indicate you want to overwrite the file:
<Esc>:w!<Enter>Using an exclamation mark also confirms you want to "save as" over a file that already exists. For example:
<Esc>:w! file name<Enter> NoteYou can only overwrite a file if you have the proper permissions to do so.
Related information
- Unix help and command listing.
- Guide to using the vi text editor.
- Guide to using vim, the "improved" version of vi.
- See our Unix definition for additional information.
- Linux help and support.
Từ khóa » Vi In Linux Save
-
An Introduction To The Vi Editor | Enable Sysadmin - Red Hat
-
How To: Vi / Vim Save And Quit The Editor Command - NixCraft
-
How To Save A File In Vi / Vim Text Editor - NixCraft
-
How To Save A File In Vi / Vim Editor & Quit - PhoenixNAP
-
How To Save A File In Vim / Vi And Quit The Editor - Linuxize
-
Using Vi? Here's How To Open A File Then Save And Quit - MakeUseOf
-
How To Save A File In Vi / Vim Editor In Linux - Tecmint
-
Saving Changes And Quitting Vi
-
How To Save & Quit In VIM Or VI | OSXDaily
-
Saving Files And Quitting Vi
-
How To Save A File In Vim/Vi? - LinuxTect
-
VI Editor With Commands In Linux/Unix Tutorial - Guru99
-
How To Save A File In Vi / Vim And Quit Editor - TecAdmin
-
How To Exit (quit) Linux Vi Editor With Or Without Saving Changes Step ...