LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I open a text editor in a shell terminal? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-open-a-text-editor-in-a-shell-terminal-387684/)

alex1986 11-29-2005 04:25 PM

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

tuxrules 11-29-2005 04:30 PM

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,

kurtdriver 11-29-2005 04:43 PM

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>

titopoquito 11-29-2005 04:52 PM

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).

ethics 11-29-2005 06:59 PM

I'm not a fan of VI (or emacs on the CLI), i use joe or pico/nano very straight forward.

number9 11-29-2005 08:14 PM

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 .

kurtdriver 11-29-2005 08:37 PM

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)!

hack124x768 11-29-2005 09:39 PM

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.

arrenlex 11-29-2005 11:30 PM

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.

alex1986 11-30-2005 03:52 PM

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.


All times are GMT -5. The time now is 04:59 AM.