[juneau-lug] Re: How Can I Do A Terminal Capture to Text file w/Linux ?

  • From: James Zuelow <e5z8652@xxxxxxxxxx>
  • To: juneau-lug@xxxxxxxxxxxxx
  • Date: Wed, 19 Feb 2003 07:08:15 -0900

On Wed, 19 Feb 2003 06:31:03 -0900
"eastwind" <eastwind@xxxxxxxxxxxx> wrote:

> 
> Hiya folks.
> 
> I need to capture the output of various terminal sessions
> to a text file under Linux.
> 
> So far, it doesn't appear that I can right-click/copy-paste
> in KDE using a terminal window.
> 
> So what's the easiest way to do this?
> Is there a GUI method?
> 
Try selecting the output with your mouse, and then pasting it into an
application.  The act of selecting it also copies it.  (I mainly use
Gnome, so don't know if this is KDE behavior.  But I believe it is
"standard".)


> Barring that...what's the general setup for redirecting
> stdout to a text file and is that my only option?

If that's the way you have to go, here's the bash syntax:

command > file

the stdout from command will be redirected to file.  You may also need
to do:

command 2> file

the stderr from command will be redirected to file.  (Sometimes the
standard error messages are more interesting.)

command > file.out 2> file.err

redirects both to different files.  You can also do

command >> file 2>> file

to put them in the same file.  Note that I used >> instead of > - this
is to prevent the two outputs from overwriting each other.  (>>
appends output without erasing first, > will erase a file and start
over every time it is called.)

"Linux in a Nutshell" has a pretty good reference on bash & tsh/csh
syntax, including redirection.  I'd recommend you pick up a copy.  Be
sure you get the latest edition.

Cheers,

James

------------------------------------
This is the Juneau-LUG mailing list.
To unsubscribe, send an e-mail to juneau-lug-request@xxxxxxxxxxxxx with the 
word unsubscribe in the subject header.

Other related posts: