->Title Page
->Intro
->Unix
->Vi editor
-->Basics
--->Moving around
--->Deleting text
->Saving and quitting
--->Editing
--->Search and Replace
--->Undo
--->Repeat
-->Vi reference
-->Miscellaneous tips
->Mirror sites
->Further reading

[ Up ]
[Prev][Home][Next]
[Author]

Vi ---> Saving and Quitting


     :w    write to disk
     ZZ    write to disk and exit
     :q!   exit without writing to disk
Actually, the command for quitting vi is :q. You can save and quit by typing :wq but ZZ does the same thing1 and takes one less keystroke. If there are unsaved changes to the text and you try to quit using :q, vi will warn you that you have unsaved changes and will prevent you from quitting. In order to quit without saving the changes you must use the override switch, !.

Site Statistics

1 For the purist, :wq and ZZ are not exactly the same. :wq always saves, whereas ZZ saves only if changes have been made since the last save.

Find this site useful? Want to give something back?

t a y l o r@l i n u x a v e.n e t

© 1993-2000 Christopher C. Taylor