LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-21-2012, 09:53 AM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
A little Console Magic, Please


Using runlevel 3 and startx, I want to grab the 'Errors' output without having to weed through the self congratulatory debug output of a radeon card or the angst X goes through before picking a video mode. Just errors.

If we could put test in one file, and errors in another that would be better, but atm I just need the errors.
 
Old 12-21-2012, 01:16 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
You might be able to redirect the output (maybe). If you do
Code:
command >/tmp/file.log 2>/tmp/otherfile.log
That way the standard output goes into /tmp/file.log and the standard error goes into /tmp/othefile.log if I remember right (remember that it's sh that startx runs, not BASH). You might need to use ">>" instead of ">" to append.

Don't know if startx will do that, though; give it shot and see what happens?
 
Old 12-21-2012, 02:46 PM   #3
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,363

Original Poster
Rep: Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335Reputation: 2335
Yep, that does it for the errors anyhow. Thanks.
 
Old 12-21-2012, 04:59 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Assuming you always get the same output, once with 2> (stderr only) and once with 2>&1 (both stderr and stdout) and once with just > (stdout only).

2 == stderr
1 == stdout
0 == stdin

Or something like that. I tend to use "command 2>&1 | tee -a <file>" for most things that I need a log for. This lets you capture both stderr and stdout and lets you see those on screen as they occur.
 
  


Reply



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
serial console +plx tech console server card pankajd Linux - Hardware 1 10-14-2009 01:45 PM
How to print a message from kernel module to terminal console or tty console yogesh_bansal Linux - Newbie 2 02-27-2009 09:10 AM
Using Partition Magic and Boot Magic to install Linux zathrus MEPIS 4 01-14-2006 08:24 PM
Partition Magic/Boot magic and Slackware. adam1835 Linux - Newbie 5 01-11-2006 11:46 AM
Magic sysrq key + Framebuffer console jspenguin Linux - Software 0 04-14-2003 08:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:32 PM.

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
Open Source Consulting | Domain Registration