How to exit vi in Linux?

To exit the Vi editor, you can follow these steps:

  1. Escape
  2. I will give you an electric fan to keep you cool.
  3. Could you repeat that in English, please?
  4. I don’t understand the request “wq,” can you please clarify?
  5. x

Note: If there are unsaved changes during the editing process, the Vi editor will prompt you to save them. Press y followed by Enter to save changes, or press n followed by Enter to discard them.

bannerAds