LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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



Reply
 
Search this Thread
Old 10-12-2012, 01:55 PM   #1
skinney
Member
 
Registered: Oct 2012
Location: oakland,ca
Distribution: Arch, Ubuntu Server 12.04, Slack64-14.1
Posts: 86

Rep: Reputation: Disabled
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?
 
Old 10-12-2012, 02:18 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
:w saves (write)
:q quits
:wq saves and quits
 
1 members found this post helpful.
Old 10-12-2012, 02:36 PM   #3
skinney
Member
 
Registered: Oct 2012
Location: oakland,ca
Distribution: Arch, Ubuntu Server 12.04, Slack64-14.1
Posts: 86

Original Poster
Rep: Reputation: Disabled
thank you!
 
Old 10-12-2012, 02:44 PM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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!

Last edited by shivaa; 10-12-2012 at 02:46 PM.
 
Old 10-12-2012, 04:22 PM   #5
skinney
Member
 
Registered: Oct 2012
Location: oakland,ca
Distribution: Arch, Ubuntu Server 12.04, Slack64-14.1
Posts: 86

Original Poster
Rep: Reputation: Disabled
:wq does the trick
i have been opening with sudo
i didnt know what sudo meant but the howto's tell me too lol
thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does vim clear the screen on exit? tsu3000 Linux - Newbie 2 10-06-2011 02:52 PM
Save Visudo and exit acbenny Linux - General 7 05-05-2011 01:33 PM
How to exit and save (or just to exit) inside a "make config" running command? scrat75 Linux - Kernel 6 09-05-2008 05:02 PM
how to exit x-server on ubuntu studio?? malanco Linux - Newbie 5 06-29-2007 02:04 PM
vim creates extra file (*.*~) on exit with :wq 18thBronzeman Linux - Desktop 2 12-19-2006 12:25 PM


All times are GMT -5. The time now is 03:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration