Vi / Vim: Quit Without Saving Command

by on January 21, 2013 · 2 comments· LAST UPDATED April 28, 2013

in , ,

I am a new vi / vim text editor user. How can I quit the vi / vim text editor without saving my changes to a file under Linux / Unix like operating systems?

Tutorial details
DifficultyEasy (rss)
Root privilegesNo
RequirementsNone
Estimated completion timeN/A
You can quit the vim or vi text editor without saving any changes you may have made to the file. First, you need to press Esc key to get out of insert or append mode.

Next type colon (: symbol)

You see the cursor at the lower left corner of the screen. Finally, type the following command to quit without saving anything to a file:

q!
WARNING! This will force vi/vim to quit the editor, and all changes you have made to the document will be lost forever..
Fig.01: Vim / vi text editor quit without saving changes command demo

Fig.01: Vim / vi text editor quit without saving changes command demo

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 2 comments… read them below or add one }

1 The Brain June 22, 2013 at 4:07 am

Thank you!

Reply

2 mohamedabdallah November 17, 2013 at 12:00 pm

Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: