Vi / Vim Save And Quit The Editor Command

Originally published at:

I am a new vi / vim text editor user. How do I quit the vi editor and save my changes under a Linux or Unix like operating systems? Can you tell me command to save and quit file in vim?

  1. I press Escape key
  2. Type :
  3. To save and exit vim, enter wq!

:wq! is forceful save and exit vim command.