How to Exit from Linux CLI Editor / VIM

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


  1. Press Esc key 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.
  2. :q – quit if no changes were made
  3. :q! – quit and destroy any changes made
  4. :wq – write changes (save) and quit
  5. :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.



, , ,




One response to “How to Exit from Linux CLI Editor / VIM”

  1. ubuntu Avatar

    My partner and I stumbled over here by a different page and thought I should check things out. I like what I see so now i am following you. Look forward to looking at your web page again.

Leave a Reply

Your email address will not be published. Required fields are marked *