LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-06-2004, 08:43 AM   #1
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Rep: Reputation: 15
Text editor in RH9 shell?


Hello,

Very simple question. What is the text editor when I'm in shell on RH9. I want to edit a .cfg file but don't want to go into GUI for just that.

Thanks for any answers.

deWin.
 
Old 03-06-2004, 09:05 AM   #2
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Errr..don't know what editor is installed by default. Perhaps try doing:
apropos editor
or simmilar?
vi or vim or emacs or pico or ed
 
Old 03-06-2004, 11:17 AM   #3
matador
Member
 
Registered: Jul 2003
Location: sweden
Distribution: gentoo @home, RH @ school
Posts: 107

Rep: Reputation: 15
I prefer pico. It's included in the pine package. You can find can it via urpmi or rpmfind.
 
Old 03-06-2004, 11:52 AM   #4
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
woah! lol english please guys. I mean like in dos you can use the command "edit blah.txt" to edit it and save it. I'll try some of the above but too many choices i guess.
 
Old 03-06-2004, 12:02 PM   #5
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
ok i got the vim, opened the file and edited it. Now how do i save that file. i did vim myfile.txt and it opened up the file allowing me to edit. I hit CTRL+Z it stops, I hit CTRL+S it freezes.
 
Old 03-06-2004, 12:08 PM   #6
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Vim is complicated. But it's geeks favorite editor. Here are some commands:

vim <what you want to edit>

ESC: wq

That is for (w)rite and (q)uit. Press in that order, "ESC", then ":" then "wq", then enter. If you feel that you messed up, press:

ESC: q!

That is to quit without saving changes. I will find to you a vim command list. Be right back
 
Old 03-06-2004, 12:10 PM   #7
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Here:

http://www.fprintf.net/vimCheatSheet.html

If you think it stinks, you might consider using another editor. At least at the beginning. I warn you though, once you get the hang of vim, you will be freaking addicted to it and you won't ever be able to use anything else . lol
 
Old 03-06-2004, 04:16 PM   #8
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
oh no it's absolutely fine. Thanks for the command, of course without knowing command no one can do anything and I thought it'd be like CTRL+S It works like a charm and I like the editor, plus that commands list will come in handy. I just hoped i could get the same list by vim --help command.
 
Old 03-06-2004, 05:06 PM   #9
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Cool! My pleasure .

You could also try "man vim" at the terminal. It will bring a lot of stuff about vim usage with details. But I really like that table the best

Cheers!
 
Old 03-06-2004, 05:49 PM   #10
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
ESC wq for some reason just beeps, no error and it doesn't save. Any ideas? The file is not readonly.
 
Old 03-06-2004, 05:56 PM   #11
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
It should be ESC: wq

don't forget the ":"
 
Old 03-06-2004, 06:15 PM   #12
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
i thought it was a sequence of keys, so is it the key ESCAPE, shift+; letter w and q and then enter, correct?
 
Old 03-06-2004, 06:38 PM   #13
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
exactly, press then in a sequence, first Escape, then : then w, then q, then enter. You not really have to press Escape, only when you are at "Insert mode". The ":" brings you to command line, where you can type stuff to pass to the editor. But get used to always press escape to make sure you are not using any mode. For you to see the power of vim, here are some more examples that I use often:

ESC: set tabstop=4

That will make all "Tab" presses with a space equivalent of 4 spaces. Great for programming

ESC: syntax on

That will make the text highlight, for most of programming and tag languages around

ESC: set vb

That will stop those annoying beeps . See? Isn't it great? And there's much, much more. Everyday I find a new thing for vim

Last edited by Mega Man X; 03-06-2004 at 06:39 PM.
 
Old 03-06-2004, 08:49 PM   #14
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Quote:
Originally posted by lugoteehalt
Errr..don't know what editor is installed by default. Perhaps try doing:
apropos editor
cool...apropos is a new one to me. Thanks for the tip.

vimtutor was a handy primer for me.
 
Old 03-06-2004, 10:25 PM   #15
deWin
Member
 
Registered: Feb 2004
Distribution: Red Hat 9
Posts: 113

Original Poster
Rep: Reputation: 15
Works nicely now. It's for sure a powerful tool so i'll be spending some time on it and if I get stuck, I know where to go.

I want to ask another question but I'm not gonna start a new thread. I have a set of files, huge files around 1.2GB for a set of files. I know there is something called linking the files or something where you can have duplicate copies of those files but they won't take up physical space since they are actually just link to the original file.

Now this is a folder e.g. called folder1 and I want to create a folder2 and link files and subfolders from folder1 to folder2. How would I do that. Yup! I've got a small HD so it'd be nice if I could do that.

Also how many links can I create with one set of files?
 
  


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
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM
How do I open a text editor in a shell terminal? alex1986 Linux - Newbie 9 11-30-2005 03:52 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
text editor Mig21 Linux - Software 17 07-07-2005 05:27 PM
Simple Guide on creating text editor in shell. xushi Programming 2 02-06-2004 01:37 AM


All times are GMT -5. The time now is 07:49 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration