LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-02-2004, 08:05 PM   #1
Ree
LQ Newbie
 
Registered: Sep 2004
Posts: 15

Rep: Reputation: 0
Editing text file in Shell - Konsole (SuSE 9.1)


I am trying to edit a text file through the shell console and i open it by typing "vi {filename} push i to inster text then i dont know how to save it. When i close the shell and open it again, the file is still what it used to be. Help please.

~rEE
 
Old 10-02-2004, 08:12 PM   #2
jens
Senior Member
 
Registered: May 2004
Location: Belgium
Distribution: Debian, Slackware, Fedora
Posts: 1,193

Rep: Reputation: 159Reputation: 159
Start as root.
#vi filneame
press "Insert" for edit mode
edit what you like
press "Esc" lo leave "Edit mode"
type :wq! and press "Enter" to save and quit...

Last edited by jens; 10-02-2004 at 08:18 PM.
 
Old 10-02-2004, 08:27 PM   #3
Ree
LQ Newbie
 
Registered: Sep 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Score, thanks!
 
Old 10-03-2004, 06:40 AM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Just so you know, vi is an incredibly powervul text editor. You may want to check this out:
vi Tutorial
 
Old 10-03-2004, 10:59 AM   #5
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: Debian Wheezy
Posts: 2,838

Rep: Reputation: 48
Check out "pico filename.txt"
Common options are listed plainly at the bottom of the screen (CTRL plus the named key).
Midnight Commander ("mc") is also a nice way to navigate and edit files. Options using the function keys are listed.
To edit system files you would still need to switch user ("su") to root.
 
Old 10-03-2004, 11:48 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
To exit and save in vi/vim:
Esc
:x <enter>
 
1 members found this post helpful.
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED AWNSER QUICK how do I save editing a text file in Konsole? DDRfreak2 Mandriva 1 08-18-2005 06:09 PM
How to find and change a specific text in a text file by using shell script Bassam Programming 1 07-18-2005 07:15 PM
Editing text file for import to a spread/database Franklin Programming 7 03-31-2004 06:31 AM
Some techniques for text file editing ganninu Programming 17 10-09-2003 05:34 PM
Editing a text file in shell Lotmr Linux - Software 5 06-24-2003 12:12 PM


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