vi Editor: Starting & Exiting To enter vi, just type `vi' followed by the name of the file to edit:
This will cause vi to read the file into its memory and allow you to edit it. If the file does not exist, vi will tell you so and then proceed to edit a new file which will be created when you exit the editor.
There are command options to vi that allow you to start up your editing session while placing the cursor at different locations of the file:
vi + filename
vi +50 filename
vi +/main filename
vi -r filename
To exit vi, use the one of the following two commands: