Exiting/ quitting vi/Vim Editor without saving the file

You are here : Home / LINUX Tutorials

In this tutorial we will learn how to edit file in vi/Vim Editor - Save and quit in linux.



Contents of page >
  • Exiting/quitting vi/Vim Editor without saving the file in linux>
  • SUMMARY, for exiting/quitting vi/Vim Editor without saving the file in linux>


Exiting/quitting vi/Vim Editor without saving the file in linux>

STEP1 : How to quit/exit vi/Vim Editor without saving the file >

Press Esc key on keyboard

Pressing Esc will remove
-- INSERT --
from editor and editor will look like this

STEP2 : How to quit/exit vi/Vim Editor without saving the file >

Type ’:’ (colon)

Typing ’:’ (colon) will put colon on lower left like this

STEP3 : How to quit/exit vi/Vim Editor without saving the file >

Type
‘q!’

OR, if you haven’t edited file you may type


STEP4 : How to quit/exit vi/Vim Editor without saving the file >

Press Enter
You will quit vi/Vim Editor without saving the file.



SUMMARY, for exiting/quitting vi/Vim Editor without saving the file in linux>

STEP1 : How to quit/exit vi/Vim Editor without saving the file >

Press Esc key on keyboard

STEP2 : How to quit/exit vi/Vim Editor without saving the file >

Type ’:’ (colon)

STEP3 : How to quit/exit vi/Vim Editor without saving the file >
Type
‘q!’

STEP4 : How to quit/exit vi/Vim Editor without saving the file >
Press Enter
You will quit vi/Vim Editor without saving the file.



Also Read : For quitting vi/Vim Editor with - saving the file> Quitting vi/Vim Editor with - saving the file in linux



Having any doubt? or you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.


RELATED LINKS>

How to edit file in vi/Vim Editor in linux - Save and quit

Quitting vi/Vim Editor with - saving the file in linux

vi error - E37: No write since last change (add ! to override)

bash: ./yourScriptFile.sh: Permission denied Linux solved



Labels: Linux
eEdit
Must read for you :