Often for newbies how to exit form VIM or CLI (command line interface) editor is confusing. I’ve seen people just close the CLI in out of frustration. Follow the instruction below if you finding it hard to exit from VIM
Esckey couple of time. This will ensure that you are back in normal mode. Then try one of the options below depending on what you want.
:q– quit if no changes were made
:q!– quit and destroy any changes made
:wq– write changes (save) and quit
:x– similar to
:wq, only write the file if changes were made, then quit
Hope it helps 🙂
For more information look at this AskUbuntu question.