Jump to content

How to show output of TTY1?


Guest joehill
 Share

Recommended Posts

Guest joehill

I would like to show the output from tty1 while in x so that I can troubleshoot x apps. I understand the tool for this is "tail" and i have figured out how to monitor /var/log/messages, but I don't know how to do it for the terminal output.

 

I'm thinking that I could maybe have the tty output directed to a text file and then have tail monitor that text file, but how to do that?

Link to comment
Share on other sites

I asume that you start the X server from runlevel 3 (text mode).

 

The easiest way will be:

user@host ~$ startx &> Xoutput

 

That will redirect stdout and stderr to Xoutput file, which you can monitor while in X using:

user@host ~$ tail -f Xoutput

 

One step ahead will be to redirect stdout to a file and stderr to another file:

user@host ~$ (exec > X_std_output; exec 2> X_std_error; startx ) &

where X_std_output will archive stdout messages, and X_std_error will keep the error ones. Also, notice that that command will create a subshell in the background form where startx is launched, since the redirections only affect that subshell, you'll have your TTY intact and ready for running whatever you want.

 

There are many other ways to do it (for example duplicating the file descriptors).

 

HTH

Link to comment
Share on other sites

Guest joehill

many thanks!

 

I am embarassed it's so simple, but not surprised I missed it, know what I mean?

 

now let me figure out how to keep the output file from filling my harddrive... :roll:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...