How to edit, save, and quit without saving in the VI editor

How to edit, save, and quit without saving in the VI editor.

To quit the VI editor and save changes, perform the following procedure:

1.If you are currently in the insert or append mode, press Esc.
2.Press : (colon). The cursor will be re-displayed at the lower left corner of the screen, besides a colon prompt.
3.Type q!. This will quit the editor and all changes that were made to the document will be lost:

Use the following commands to write and quit the VI editor:

Note: ‘:w’ saves the current file, but does not exit.

About the author

James Palmer

Leave a Comment