How to save and quit vi command in linux

It took me some time to figure out how to work with vi command in linux. The main problem i was having was that i edited a file and then was not able to save and quit vi. Later after some research i found it was quite simple.

to edit a file in vi type:

vi [filename]

to save and exit in vi type:

:wq

to just quit without saving type:

:q


No related posts.

Leave Your Response

* Name, Email, Comment are Required