Saving Changes And Quitting Vi
Có thể bạn quan tâm

- Previous: Two Modes of vi
- Next: Printing a File
Saving Changes and Quitting vi
vi is rich in substantively synonymous commands that control the save of the buffer contents to a file and the exit from vi. These commands give you the option of saving, saving-and-quitting, or quitting-without-saving.
Saving
Save the contents of the buffer (write the buffer to the file on disk) by typing:
| :w |
Press Return.
Saving and Quitting
Save and quit by typing:
| :wq |
Press Return. Alternatively, type ZZ.
Note that the command ZZ is neither preceded by a colon nor followed by Return.
Quitting Without Saving
When you've made no changes to a file and want to quit, type:
| :q |
Press Return. If you have made changes, vi does not let you quit with :q. Instead, it displays the following message.
| No write since last change (:quit! overrides) |
If you do not want to save your changes, type:
| :q! |
Press Return.
- Previous: Two Modes of vi
- Next: Printing a File
- © 2010, Oracle Corporation and/or its affiliates
Từ khóa » Vi Commands Exit
-
More Linux Resources
-
How To Exit (Quit) Linux Vim/Vi Editor - PhoenixNAP
-
How To Exit (quit) Linux Vi Editor With Or Without Saving Changes Step ...
-
How To Exit The Vi Or Vim Editor - How-To Geek
-
Quit The Vi Editor Without Saving Your Changes
-
How To: Vi / Vim Save And Quit The Editor Command - NixCraft
-
How To Exit Vim – Vim Save And Quit Command Tutorial
-
How Do I Exit Vim? - Stack Overflow
-
How To Exit From Vi In Linux Code Example
-
How To Exit A File In Vi / Vim Editor In Linux - Tecmint
-
Basic Vi Commands - Colorado State University
-
How To Exit Vim? Multiple Ways To Quit Vim Editor - It's FOSS
-
How To Save A File In Vim / Vi And Quit The Editor - Linuxize
-
10 Ways To Quit/Exit From Vim Editor In Linux/UNIX? Examples - Java67