LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 12: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, 01:18 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

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, 01: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, 01:44 PM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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 01:46 PM.
 
Old 10-12-2012, 03: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



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 01:52 PM
Save Visudo and exit acbenny Linux - General 7 05-05-2011 12:33 PM
How to exit and save (or just to exit) inside a "make config" running command? scrat75 Linux - Kernel 6 09-05-2008 04:02 PM
how to exit x-server on ubuntu studio?? malanco Linux - Newbie 5 06-29-2007 01:04 PM
vim creates extra file (*.*~) on exit with :wq 18thBronzeman Linux - Desktop 2 12-19-2006 11:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:58 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
Open Source Consulting | Domain Registration