how do I save after editing

May 5, 2015 2.3k views
LEMP Ubuntu

I am asked to add to a file using sudo vi /etc/nginx/sites-available/ I add the text I want but how do I save the new text ? I tried ctrl x but that didn't work ?

2 Answers

Exit vi text editor, while saving any changes made:


In vim you can enter a colon : to enter command mode and then press "x" to save and press enter.

Have another answer? Share your knowledge.