Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
04-30-2007, 10:40 PM
|
#1
|
Member
Registered: Jan 2007
Location: Draper, UT
Distribution: Ubuntu, Windows 10, OSX
Posts: 461
Rep:
|
Server NOOB - how do i save a file after VI?
Hello, after VI.... a file, how do i save it and return to command prompt?
|
|
|
04-30-2007, 11:05 PM
|
#2
|
Member
Registered: Jul 2006
Location: Joinville, Brazil
Distribution: Debian, CentOS
Posts: 301
Rep:
|
press:
esc
:
w
(this will save)
you can also do:
esc
:
wq!
(this will save and leave the editor)
|
|
|
04-30-2007, 11:14 PM
|
#3
|
Member
Registered: Jan 2007
Location: Draper, UT
Distribution: Ubuntu, Windows 10, OSX
Posts: 461
Original Poster
Rep:
|
do i press that all at the same time or do i press escape then : then wq?
|
|
|
04-30-2007, 11:58 PM
|
#4
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
You press them sequentially.
|
|
|
05-01-2007, 12:00 AM
|
#5
|
Member
Registered: Jan 2007
Location: Draper, UT
Distribution: Ubuntu, Windows 10, OSX
Posts: 461
Original Poster
Rep:
|
Ok, thanks
|
|
|
05-01-2007, 03:57 AM
|
#6
|
Moderator
Registered: Aug 2002
Posts: 26,800
|
actually
:wq - save file and exit
:q - quit, will refuse if unsaved changes exist
:q! - quit without saving changes.
:x - save file if changed and quit
Just google for a complete list of vi commands.
|
|
|
05-03-2007, 01:00 AM
|
#7
|
LQ Newbie
Registered: Feb 2004
Posts: 7
Rep:
|
If you have a redhat distro, you may want to run through "vimtutor", that will open a file with a VIM guide and you just walk your way through it.
|
|
|
05-03-2007, 01:06 AM
|
#8
|
Senior Member
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
|
If you're lazy, you can type in "ZZ" to save and quit (capitalization matters).
|
|
|
05-03-2007, 11:20 AM
|
#9
|
Member
Registered: Jan 2007
Location: Draper, UT
Distribution: Ubuntu, Windows 10, OSX
Posts: 461
Original Poster
Rep:
|
Ok, thanks, 
|
|
|
All times are GMT -5. The time now is 02:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|