LinuxQuestions.org
Help answer threads with 0 replies.
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 11-29-2005, 05:25 PM   #1
alex1986
Member
 
Registered: Nov 2005
Location: Ottawa, Canada
Distribution: none yet
Posts: 96

Rep: Reputation: 19
How do I open a text editor in a shell terminal?


I want to edit my /etc/rc.d/rc.local from my terminal window (vid card won't allow me to run 2 GUI's at once, ATI at it's FINEST)

I'm trying to get my Lisa Daemon running. I heard that if I add:

if [ -x /opt/kde/bin/lisa ]; then

echo "Starting LISa daemon..."

/opt/kde/bin/lisa

fi

to rc.local it schould do the trick (yes my lisa script is at that location), is it just that easy or am I being set up for more trouble?

but my main question is how do I open a txt editor from the shell console.

running Slackware Kernel 2.6.13
 
Old 11-29-2005, 05:30 PM   #2
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,144

Rep: Reputation: 56
Hi,
That should be easy. Open up a terminal and

Code:
su -
Enter your root password
you need to do this since only root is allowed to write rc.local file.

Code:
vi /etc/rc.d/rc.local
vi here is the name of the editor

press Esc key to enter into "insert" mode. Modes in vi are displayed in bottom right corner.

<type in what you want>

press Esc again to enter command mode

Code:
:wq
will save and exit you out of vi.

Tux,

Last edited by tuxrules; 11-29-2005 at 05:33 PM.
 
Old 11-29-2005, 05:43 PM   #3
kurtdriver
Member
 
Registered: May 2005
Location: Vancouver, Canada
Distribution: Fedora 18, Puppy Linux, various others
Posts: 107

Rep: Reputation: 15
There are other editors, and they are most often easier to use than vi. emacs is installed on most linux boxes and jed is preferred by many. If you don't have jed type as root
<i> yum install jed</i>
 
Old 11-29-2005, 05:52 PM   #4
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,594

Rep: Reputation: 124Reputation: 124
Forget about yum on Slackware, but kurtdriver is of course right. Vim is a moloch, it's a great but also difficult program for beginners. If you want to learn it try "vimtutor" which will guide you through your first steps with vim.
Another choice is Emacs, even simpler is pico (pine has to be installed to use it).
 
Old 11-29-2005, 07:59 PM   #5
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
I'm not a fan of VI (or emacs on the CLI), i use joe or pico/nano very straight forward.
 
Old 11-29-2005, 09:14 PM   #6
number9
Member
 
Registered: Dec 2003
Location: Fresno
Distribution: Gentoo Ricer
Posts: 85

Rep: Reputation: 15
The vi is too complex if you are unable to even open a basic command line text editor. What you need is nano , pico or joe .
 
Old 11-29-2005, 09:37 PM   #7
kurtdriver
Member
 
Registered: May 2005
Location: Vancouver, Canada
Distribution: Fedora 18, Puppy Linux, various others
Posts: 107

Rep: Reputation: 15
Pine does not need to be installed in order to use pico, which is pine's editor. Pine does, however, require either nano or pico.
P.S. Pine is a great email client (pardon the change of topic)!

Last edited by kurtdriver; 03-27-2006 at 09:48 PM.
 
Old 11-29-2005, 10:39 PM   #8
hack124x768
Member
 
Registered: Mar 2004
Location: everett
Distribution: slak
Posts: 61

Rep: Reputation: 15
vi isnt too hard if you have a printout of the man page handy, or dont mind switching virtual terminals a lot. And about two gui;s, how the heck would that work? two monitors? Only one X server can be running, and I think multiple displays using one monitor would be weird at best.
 
Old 11-30-2005, 12:30 AM   #9
arrenlex
Member
 
Registered: Jul 2005
Distribution: Debian Etch
Posts: 48

Rep: Reputation: 17
Don't use vi if you're a newbie. Really. Don't.

Type 'nano' for a nice, easy, intuitive text editor. Type 'nano <path to file>' to edit the file you want to edit. ctrl + x to quit, and then press s to confirm save. Like money, fame, and other good things in life, vi is incredibly powerful but hellishly difficult to manage.
 
Old 11-30-2005, 04:52 PM   #10
alex1986
Member
 
Registered: Nov 2005
Location: Ottawa, Canada
Distribution: none yet
Posts: 96

Original Poster
Rep: Reputation: 19
Quote:
Originally posted by isthisworking
And about two gui;s, how the heck would that work? two monitors? Only one X server can be running.
type your normal "startx" from your tty1 like you would to start KDE.
let it load.
switch to tty2, in my case I press Alt+Ctrl+F2
and type "startx -- :1"
it's essentially the same Gui running twice.....nice thing is you can log into the first one as regular and the second one as root.
 
  


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
Whats your favorite terminal text editor??? Necronomicom Linux - Software 8 12-16-2011 07:45 AM
How to open A file with an editor through my shell amer_58 Linux - Newbie 12 03-11-2005 07:19 AM
Can't open text editor as root - SuSE 9.2 dcdbutler SUSE / openSUSE 9 02-17-2005 05:38 PM
Text editor in RH9 shell? deWin Linux - Newbie 15 03-07-2004 01:30 AM
Simple Guide on creating text editor in shell. xushi Programming 2 02-06-2004 02:37 AM


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