[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Howto redirect output from a terminal



Michael Kahle wrote:
> a terminal in X.  As it was running I could see in the terminal window all
> the status output from the program.  Good.  This backup job took a long time
> to complete and so I went home while the backup was still running.  When at
> home I ssh'd into the box to see if the dump process was still running, it
> was.  Then I got to thinking, how can I see the output of this program in my
> current ssh session?  Is there a program that exists to allow me to redirect
> the output of a program running in a terminal to another terminal?  I hope I
> am explaining this clearly.

With some forethought.  But not if you just ran it cold.

1. You can redirect the output to a file.  Then look at the output of
   the file remotely.

     command 2>&1 | tee logfile

   Then on the remote computer just look at the log file.

     tail -f logfile
   or
     less logfile

2. You can use the 'screen' program to run your command.  Screen is a
   really nice utility that allows you to run a command one place,
   then pick it up again someplace else.  Here is a simple example.

     screen
     ...then run commands...

   On your remote login grab this screen window and see what is
   happening.

     screen -d -r
     ...then see your commands from before...

    apt-get install screen

3. Use VNC which is a fully graphical version of the above.  Which is
   really describing it too simply but good for now.

     apt-get install xvncviewer vncserver

You will need to read the manuals to really know how to use the
above.  But perhaps those pointers will be useful.

Bob

Attachment: pgpHV3UXmpHvX.pgp
Description: PGP signature


Reply to: