VI basic basics

Starting:

vi filename          edit filename starting at line 1
vi -r filename     recover filename that was being edited when system crashed

Exiting:

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

To edit a file just “esc” to make sure your at the command prompt then hold “Control and the letter I” This is the normal edit mode.

When your done click “esc” again and then type “:w” to save the file.

Then type “:q” to exit.