I am currently following a tutorial that asked to open a file with "sudo vi /..." first and formost I have half an understanding of how to type but I managed and now I need to save the file but how do I do that? I tried to use ctrl x but that doesnt work and there is no other means in the file/ edit section of the terminal. Please help.

kind regards coolxm


To save, press:


That is, the 'colon' key, then the 'w' key. Then the enter key.

To save and quit, hold the shift key, and hit 'z' twice.

To quit without saving, hit:


Then the enter key.

Not the answer you're looking for? Browse other questions tagged or ask your own question.