How to save file in vi editor?

Hi,

I am trying to find commands to save the file in the vi editor? Can anyone show me the example and explain me the commands?

Thanks

View Answers

June 16, 2016 at 7:32 PM

Hi,

Here are the details:

How to save file in vi editor?

  1. Press 'Esc' button to go to the Command mode and ':' appears
  2. Type :w to save the file
  3. Type :wq to save and quit
  4. Type :q! to quit without saving
  5. Type :wq! to force write to file even if it does not have write permission
  6. Type: x to write and quit and this command is short for :wq
  7. Type :qa to quit all

Thanks


June 18, 2016 at 2:42 AM

Here is the video instruction of saving the file in vi editor:

Thanks









Related Tutorials/Questions & Answers:
Advertisements