LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-03-2011, 05:53 AM   #1
xombboxer
Member
 
Registered: Apr 2011
Posts: 63

Rep: Reputation: 0
capturing everything from screen to text file


I am running a make, i want to capture the log. need everything shows on screen in to the file.

i used >file.txt 2>&1

seems some of the things are not coming.
any other tweaks ?
 
Old 10-03-2011, 12:06 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Try

make | tee file.txt
 
Old 10-03-2011, 12:18 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

@bigrigdriver: tee, out of the box, only reads from stdout, not stderr: make 2>&1 | tee file.txt should fix that.

But that might not do what the OP asks. Are only stdout and stderr used? Maybe some stuff is redirected to a different descriptor.

Also this is kinda puzzling to me:
Quote:
seems some of the things are not coming.
Seems? It either is or is not shown
 
Old 10-04-2011, 05:32 AM   #4
xombboxer
Member
 
Registered: Apr 2011
Posts: 63

Original Poster
Rep: Reputation: 0
@druuna

I was not sure that what i was getting in file is correct.
 
Old 10-04-2011, 05:46 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

The following sends output from stdout (1) and stderr (2) to a file:
Code:
code 2>&1 1>outfile
No output should be outputted to screen (assuming only stdout and stderr are used).

The tee command as shown in my previous reply sends the output to file and to screen. Might be a good way to see if both are the same (again: assuming only stdout and stderr are used).

Hope this helps.
 
  


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
Saving shutdown text screen into a txt file. glore2002 Debian 2 03-30-2010 04:29 AM
Capturing 'screen' adamlucansky Linux - General 13 10-20-2009 08:07 AM
Creating text file with screen shots writedom Linux - Software 2 06-09-2008 07:18 AM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 03:36 PM
full screen TEXT UI editor, file manager? sick-o-windoze Linux - Newbie 6 12-01-2003 02:47 PM


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