I use nano
but it is not installed on this system. I opend the file /etc/hosts
sudo vim /etc/hosts
Made changes. How do I save files edited with vim? What keystrokes I must type. Please suggest.
I use nano
but it is not installed on this system. I opend the file /etc/hosts
sudo vim /etc/hosts
Made changes. How do I save files edited with vim? What keystrokes I must type. Please suggest.
I found solution in search. It said. The command to save a file in VIM and quit the editor is :wq
. To save the file and exit the editor simultaneously:
Esc
key to switch to normal mode.:wq
and press the Enter
key.:x
You can press ESC and then hold down the Shift key and press z twice too. For future reference see my page:
https://www.cyberciti.biz/faq/how-do-i-save-changes-in-vim/
Esc Shift+:
add :w
stay into open session, :x
direct with close the session