Vi Editor — 8 Basic Commands to get you Ready

The vi editor stands for the visual editor. It is installed in every Unix system. The vi editor has two modes:

  • Command Mode: In command mode, actions are taken on the file. The vi editor starts in command mode. Cut, copy the text and save the file; commands are case sensitive.

Creating a new file name

vi new_filename

To enter in insert mode

Just, Press


Now you are in insert mode. You can also enter to insert mode in other ways.

Just type the content to the file in insert mode, and if you Wanna go back to command mode press


Want to discard the changes in your line

Go to command mode and press


Note — Below command will work in command mode which you know how to navigate? If you are in insert mode by pressing escape key.

Save the file


Quit the file without saving


Save and Quit the file


Save and Quit the file with permissions such as nonwritable file


Thank You!

— Let me know if facing any doubts or needs to be corrected.



Indigo Starseed, Here to share life lessons.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store