Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-16-2003, 08:47 AM   #1
LQ Newbie
Registered: Sep 2003
Location: UK
Distribution: Gentoo
Posts: 22

Rep: Reputation: 15
Talking Log Screen Output to a file

Im getting lots of error message output to my screen from one of my applications and want to save the errors to a log. Does anyone know of a command to do this?

I cant simply use the the >error.txt command because taht only seems to work with an input i give it. I need something that logs everything the screen is seeing!

Old 09-16-2003, 09:12 AM   #2
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Make sure you set the app to log as verbosely as possible, then run "script ~/filename" before you go work on your app. After exiting the script session clean up any control chars.
Old 09-16-2003, 09:54 AM   #3
Registered: Aug 2003
Location: Limbo
Posts: 54

Rep: Reputation: 15
programs have three types of streams. Streams are input and output you give or get from the computer. Standard input(keyboard) standard output( stuff is show on the monitor) and standard error(also monitor). When you do this
program > file.txt
what you are saying is "direct the output that would be come to the screen(stdout) to a file instead"
You can't use the > to redirect standard error to a file, which is probably what you're getting. Instead to this
program 2> file.txt
make sure there are no spaces between the 2 and the >
this means "directe the standard error(stderr) to a file instead of to the screen(which is the default)". If you just use
program > file.txt
then you would be directing the standard output to the file, which it's not what you want in this case

Last edited by kubicon; 09-16-2003 at 09:58 AM.
Old 09-17-2003, 02:57 AM   #4
LQ Newbie
Registered: Sep 2003
Location: UK
Distribution: Gentoo
Posts: 22

Original Poster
Rep: Reputation: 15
The script command works...



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
Screen Listing Output Save in a File rolly frando Linux - Newbie 3 07-04-2005 01:23 AM
How to direct output both log file and to terminal... freebies Linux - General 1 02-25-2005 06:32 AM
How can I stop the output screen when double click the jar file antony_csf Programming 3 07-07-2004 06:38 AM
redirecting cpio screen output to file rawii Solaris / OpenSolaris 1 02-11-2004 09:28 AM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 02:07 PM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration