how do you save a file you're editing in ubuntu?

ThePiston

Senior member
Nov 14, 2004
861
0
76
I've opened up the Webmin config file /etc/webmin/miniserv.conf and edited it, but what do I do to save it? I can't push anything that lets me save it and when I do ":wq: it just exits and nothing is saved. noob BTW
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
What did you open it with? The command to save a file in vi is indeed 'w' and 'q' is quit, so hitting : to enter command mode and then typing 'wq<enter>' should save and exit.
 

ThePiston

Senior member
Nov 14, 2004
861
0
76
i got it - i was in some weird readonly mode and i didn't know how to get out of it - every time i hit : i was actually insert a ":"
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
That's insert mode, vi is a modal editor so you're either entering text or typing commands to perform on the text.
 

sciencewhiz

Diamond Member
Jun 30, 2000
5,885
8
81
Also make sure you are editing as root. If you edit it as your normal user, it will be read only.

Make sure you use sudo (superuser do), for example "sudo vim /etc/webmin/miniserv.conf"