LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-30-2007, 10:40 PM   #1
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX - Fedora
Posts: 458

Rep: Reputation: 31
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?
 
Old 04-30-2007, 11:05 PM   #2
sparc86
Member
 
Registered: Jul 2006
Location: Nuremberg, Germany
Distribution: Debian, Gentoo
Posts: 294
Blog Entries: 1

Rep: Reputation: 31
press:

esc
:
w

(this will save)

you can also do:

esc
:
wq!

(this will save and leave the editor)
 
Old 04-30-2007, 11:14 PM   #3
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX - Fedora
Posts: 458

Original Poster
Rep: Reputation: 31
do i press that all at the same time or do i press escape then : then wq?
 
Old 04-30-2007, 11:58 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You press them sequentially.
 
Old 05-01-2007, 12:00 AM   #5
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX - Fedora
Posts: 458

Original Poster
Rep: Reputation: 31
Ok, thanks
 
Old 05-01-2007, 03:57 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,816

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
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.
 
Old 05-03-2007, 01:00 AM   #7
scollier
LQ Newbie
 
Registered: Feb 2004
Posts: 7

Rep: Reputation: 0
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.
 
Old 05-03-2007, 01:06 AM   #8
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
If you're lazy, you can type in "ZZ" to save and quit (capitalization matters).
 
Old 05-03-2007, 11:20 AM   #9
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: OSX - Fedora
Posts: 458

Original Poster
Rep: Reputation: 31
Ok, thanks,
 
  


Reply

Tags
random, save, server, update, vi


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
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM
Is there a way to find the current mbps my server is pushing and then save to a file? abefroman Linux - Networking 1 10-16-2006 05:16 AM
Save mail on a samba file server kwellis Linux - Software 1 09-26-2006 04:28 AM
Mozilla 1.7 - No File Save / File Open dialogs on Slackware 10.0 jayseye Slackware 8 08-10-2004 05:52 AM
how to save a file? Longinus Programming 5 03-10-2004 10:20 PM


All times are GMT -5. The time now is 04:06 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