Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Arch, Ubuntu Server 12.04, Slack64-14.1
Posts: 86
Rep:
How do you save and exit VIM in Ubuntu server
trying to set up a ubuntu (12.04) server
totally new to linux
i'm trying to get samba running
i edit my smb.conf file and exit using "ZZ"
it takes me back to command prompt but the file doesn't change and the .smb.conf.swp remains. i get a message telling me this when i try to reopen smb.conf.
what am i doing wrong?
Vim editor is nothing but improved edition of Vi editor and all functions of Vi will also work in Vim.
In your case, you can close the file with following colon mode commands:
:w - Save
:wq - Save and quit
:wq! - Save and quit forcefully.
But as far as I could understand, in your case, it might be a problem of super-user privilages. I think you're opening the file directly as:
vim <filename>
Ubuntu don't by default gives you the root or super-user privilages, but you need to use sudo to access that. So just try to open the file with sudo command, as:
sudo vim <filename>
Enter your password:
It will give you super user privilage to modify the file.
Let me know if it helps you!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.