Saving files and exiting vi
There are several ways in which you can end your editing session, leave
vi
and return to the shell.
Saving changes
Without saving changes
Saving to another file
Quitting vi