Next: 3.12.8 Editing another file Up: 3.12 Using the vi Previous: 3.12.6 Moving commands

## 3.12.7 Saving files and quitting vi

To quit `vi` without making changes to the file, use the command `:q!`. When you type the ```:`'', the cursor will move to the last line on the screen; you'll be in last line mode.

``

In last line mode, certain extended commands are available. One of them is `q!`, which quits `vi` without saving. The command `:wq` saves the file and then exits `vi`. The command `ZZ` (from command mode, without the ```:`'') is equivalent to `:wq`. Remember that you must press after a command entered in last line mode.

To save the file without quitting vi, just use `:w`.

Next: 3.12.8 Editing another file Up: 3.12 Using the vi Previous: 3.12.6 Moving commands