Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am doing a Linux installation. I installed the system fine and am trying to change the vi /etc/hosts file. I have edited the file but am not sure how to save it.

I have --INSERT-- showing at the bottom.

share|improve this question

migrated from serverfault.com Jul 28 '10 at 15:47

This question came from our site for professional system and network administrators.

add comment

2 Answers

First press ESC so you get back to command mode, then do.

:x (quit and save)

or

:w
and
:q

or

:wq
share|improve this answer
3  
I believe you can also do :wq to save and quit in one command. –  Grant Palin Jul 28 '10 at 14:48
    
@Grant Palin, That is correct. –  Anders Jul 28 '10 at 14:52
add comment

You can also use the shortcut Shift-Z-Z from command mode (as Anders said, press Esc to exit Insert mode and return to Command mode) to save and exit to the command prompt.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.