Saving Files And Quitting Vi
Có thể bạn quan tâm
|
When editing a file, you are actually making changes to a copy of it that vi has created. After you have made several changes to a file, you can write these to the original file to update it. Before quitting vi, you must write all the changes to the file to save your work.
To save a file and/or leave vi you must switch to command mode, if you are not already in it. You can always enter command mode by pressing <Esc> until the terminal beeps or flashes at you.
There are several ways to save files and leave vi, each of which begins with you typing a colon character (:): :w Save the current file (write file) but do not exit. This command fails if the file is read-only. You can save under a different name by adding a filename: for example, :w newfile saves the current file as newfile if that file does not already exist. The command :w writes to the file if it already exists but fails if it is read-only. Use :w! to overwrite a read-only file. (The exclamation mark tells vi to ignore any error conditions.) :q Quit vi. This command fails if you have made changes to a file since the last time you saved it. (If you really want to quit without saving, type :q!. This causes vi to quit without saving the current file.) :wq Save the current file and exit vi. The command :x is equivalent to this, except that it only saves the current file if you have changed it. These commands fail if the current file is read-only, or you are editing more than one file. See ``Editing more than one file'' for details. (For information on read-only files, see ``Access control for files and directories''. Next topic: Moving around a file Previous topic: What to do if you get stuck © 2003 Caldera International, Inc. All rights reserved. SCO OpenServer Release 5.0.7 -- 11 February 2003
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
-
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 ...
-
How To Save A File In Linux After Using The Vi Command