Viewing system console messages in GUI
You can see the current contents of the text console /dev/tty1
in the file /dev/vcs1
(where 1 is the number in Ctrl+Alt+F1). (If you try to read from /dev/tty1
, you'll compete with the program running there for keyboard input.) The vcs devices are normally only readable by root. You get a snapshot; there's no convenient way to get content as it comes.
The ttysnoop program allows you to watch the traffic on a console from another terminal (including an X terminal). But this is something you have to set up in advance.
Instead of trying to catch the messages when they've been output on the text console, arrange to have the messages directed to a different location. Most such console output will end up in the system logs, in files under /var/log
. Under X (i.e. in graphical mode), you can catch these messages with xconsole
, which is part of the standard X distribution.
If xconsole
doesn't show the messages you want, edit your question to mention where these messages are coming from.
If you can't get xconsole
to show any message, edit your question to include your exact operating system, any configuration steps you've taken, and any error message you saw.
If the messages are not coming from the system logging facility, but from a program you started in the text mode console, you'll be better served by using redirection. Arrange to start the program like this:
mv ~/.myprogram.log ~/.myprogram.log.old
myprogram --with arguments 2>&1 >~/.myprogram.log
Then you can read the output from the program from anywhere by looking in the file ~/.myprogram.log
. In particular, to watch the file grow in real time, run
tail -n +1 -f ~/.myprogram.log
If the program is started by your X startup scripts, it would be better to redirect the output from the whole X startup sequence to a file. In fact many distributions do this automatically. If you're using a .xinitrc
or .xsession
file, put the following line near the beginning of the file to redirect the output from subsequent programs:
exec >"$HOME/.xsession-$DISPLAY.log" 2>&