LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-06-2004, 08:15 AM   #1
acbenny
Member
 
Registered: Jul 2004
Posts: 44

Rep: Reputation: 15
Save Visudo and exit


How can I Save Visudo after changing something and exit it.
 
Old 08-06-2004, 06:31 PM   #2
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
hi there, these may help

http://www.cs.fsu.edu/general/vimanual.html#excommands

http://www.cs.fsu.edu/general/vimanual.html

good luck.
 
Old 08-06-2004, 09:31 PM   #3
acbenny
Member
 
Registered: Jul 2004
Posts: 44

Original Poster
Rep: Reputation: 15
I saw some document, it said that if we edit the file /etc/sudoers. It is a must to use "visudo" instead of " vi ". Is it true ? However your respond is the " Vi " teaching meterial. is it mean that I use continue to use " visudo " to access the file /etc/sudoers and use " Vi " to edit and save the file.

Thanks !!!
 
Old 08-07-2004, 10:27 AM   #4
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
visudo should take the same commands as vi. i.e. to save changes and exit use

:wq

see man visudo for more info.

good luck.
 
Old 05-02-2011, 02:09 PM   #5
Bazzinga
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: 0
After a long time to discover and reply you.
Hold [shift]+press "X"
 
Old 05-05-2011, 12:52 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
In vi/vim to exit-with-changes, you only need
Code:
:x
Code:
:wq
actually means write to disk and quit-no-changes; but because you've already written to disk, using q is fine.
In any case, visudo is basically vi with a fancy frontend to check sudoers file syntax.
If you know what you're doing, any editor will do.
iirc, there's also vipw, vigr for the same reason.
 
Old 05-05-2011, 01:00 AM   #7
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I think I can type a couple capitol ZZ's faster that wq another way to save and exit
Code:
:ZZ
 
Old 05-05-2011, 12:33 PM   #8
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 2,943

Rep: Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767Reputation: 767
The reason for using visudo is that it checks the alterations before saving the file, and stops you doing anything bad. But you don't need to understand vi to use visudo: the command EDITOR=nano will make visudo use nano instead; you could even do EDITOR=gedet if that takes you fancy. If you put
export EDITOR=nano
in ~/.bashrc that will make nano (or whatever) the default permamently.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
visudo and pico crud Slackware 3 03-16-2005 04:51 AM
Run program on Linux Startuo (Save on exit won't work!) ziphem Linux - Newbie 1 01-13-2005 07:01 AM
Need help with visudo powadha Debian 2 12-19-2004 05:04 AM
visudo xviddivxoggmp3 Slackware 7 08-17-2004 08:19 PM
http config program doesnt save and exit!!! benrose111488 Linux - Software 0 06-09-2004 08:02 AM


All times are GMT -5. The time now is 11:23 AM.

Main Menu
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