LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Tags used in this thread
Popular LQ Tags , , , ,

Reply
 
Thread Tools
Old 04-30-2007, 11:40 PM   #1
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: Ubuntu 9.10
Posts: 358
Thanked: 0
Server NOOB - how do i save a file after VI?


[Log in to get rid of this advertisement]
Hello, after VI.... a file, how do i save it and return to command prompt?
mitchell7man is offline  
Tag This Post , , , ,
Reply With Quote
Old 05-01-2007, 12:05 AM   #2
sparc86
Member
 
Registered: Jul 2006
Location: Joinville - SC, Brazil
Distribution: Gentoo
Posts: 249
Blog Entries: 1
Thanked: 1
press:

esc
:
w

(this will save)

you can also do:

esc
:
wq!

(this will save and leave the editor)
sparc86 is offline     Reply With Quote
Old 05-01-2007, 12:14 AM   #3
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: Ubuntu 9.10
Posts: 358
Thanked: 0

Original Poster
do i press that all at the same time or do i press escape then : then wq?
mitchell7man is offline     Reply With Quote
Old 05-01-2007, 12:58 AM   #4
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,877
Thanked: 232
You press them sequentially.
jschiwal is offline     Reply With Quote
Old 05-01-2007, 01:00 AM   #5
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: Ubuntu 9.10
Posts: 358
Thanked: 0

Original Poster
Ok, thanks
mitchell7man is offline     Reply With Quote
Old 05-01-2007, 04:57 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 8,124
Thanked: 63
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.
michaelk is offline     Reply With Quote
Old 05-03-2007, 02:00 AM   #7
scollier
LQ Newbie
 
Registered: Feb 2004
Posts: 7
Thanked: 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.
scollier is offline     Reply With Quote
Old 05-03-2007, 02:06 AM   #8
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,358
Thanked: 1
If you're lazy, you can type in "ZZ" to save and quit (capitalization matters).
IsaacKuo is offline     Reply With Quote
Old 05-03-2007, 12:20 PM   #9
mitchell7man
Member
 
Registered: Jan 2007
Location: Provo, UT
Distribution: Ubuntu 9.10
Posts: 358
Thanked: 0

Original Poster
Ok, thanks,
mitchell7man is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 06: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 06:16 AM
Save mail on a samba file server kwellis Linux - Software 1 09-26-2006 05:28 AM
Mozilla 1.7 - No File Save / File Open dialogs on Slackware 10.0 jayseye Slackware 8 08-10-2004 06:52 AM
how to save a file? Longinus Programming 5 03-10-2004 11:20 PM


All times are GMT -5. The time now is 12:56 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration