Tuesday , October 24 2017
Home / Linux / Save And Quit The Vi and Vim Editor Command

Save And Quit The Vi and Vim Editor Command

Steps of how to quit or exit vi or vim editor

You can save and quit the vi or vim editor with saving any changes you have made by doing the following steps :

  1.  If you are currently in insert or append mode, press Esc key on our keyboard
  2.  Press : (colon). cursor should reappear at the lower left corner of the screen beside a colon prompt.
  3. Enter the following command press Enter key:
    • 😡
    • :OR
    • :x!
    • :OR
    • :wq!

NOTES :

  • :x<Enter> quit vi, writing out modified file to file named in original invocation
  • :wq<Enter> quit vi, writing out modified file to file named in original invocation
  • :q<Enter> quit (or exit) vi
  • :q!<Enter> quit vi even though latest changes have not been saved for this vi call

This will quit the editor, and all changes you have made to the document will be saved to the file.

Check Also

How to Edit Linux Ubuntu Hosts File

How to Edit Linux Ubuntu Hosts File Open putty for windows or terminal or your …

Leave a Reply

Your email address will not be published. Required fields are marked *

*