Little Girl's Mostly Linux Blog

DisplayLiveLogs

Display live logs

This page was last updated on July 18, 2009.

Display live logs in a terminal window

  • Type this command in a terminal window, replacing /PATH/TO/LOG/FILE with the path to the file you’d like to display:
  • tail -f /PATH/TO/LOG/FILE
    • Example:
    • tail -f /home/littlegirl/.xsession-errors
  • To display multiple files in one window, you can add more file names with a space between each:
  • tail -f /PATH/TO/LOG/FILE1 /PATH/TO/LOG/FILE2 /PATH/TO/LOG/FILE3
    • Example:
    • tail -f /home/littlegirl/.xsession-errors /var/log/syslog /var/log/Xorg.0.log
  • To stop displaying the live log(s), press the Ctrl and c keys at the same time.

Display a live log in an Xterm window

  • Type this command in a terminal window, replacing /PATH/TO/LOG/FILE with the path to the file you’d like to display:
  • xterm -geom 135x25+10+100 -e 'tail -f /PATH/TO/LOG/FILE'

    Now you can close the terminal window and the Xterm window will stay open, displaying the live log.

    • Example:
    • xterm -geom 135x25+10+100 -e 'tail -f /home/littlegirl/.xsession-errors'
  • Explanation of the command:
    • -geom is the size and placement of the window.
    • 135 tells -geom the width of the window. Change this to whatever number you prefer.
    • 25 tells -geom the height of the window. Change this to whatever number you prefer.
    • 10 tells -geom how far from the left edge of the monitor the window is placed. Change this to whatever number you prefer.
    • 100 tells -geom how far from the top edge of the monitor the window is placed. Change this to whatever number you prefer.
    • -e tells Xterm to execute a program (in this case it’s running the tail program).

  • To stop displaying the live log(s), close the Xterm window.

Display a live log in a custom colored Xterm window

This is a variation of the Xterm command above, using -bg and -fg to define custom background and foreground colors. When defining colors by name (like pink or green or red, etc.), no special treatment is required. When defining colors by hex codes, the hex code must be surrounded by single quotes (example: '#FF00FF').

  • Type this command in a terminal window, replacing BACKGROUNDCOLOR with the color you’d like as the background, replacing FOREGROUNDCOLOR with the color you’d like the text to be, and replacing /PATH/TO/LOG/FILE with the path to the file you’d like to display:
  • xterm -bg BACKGROUNDCOLOR -fg FOREGROUNDCOLOR -geom 135x25+10+100 -e 'tail -f /PATH/TO/LOG/FILE'

    Now you can close the terminal window and the Xterm window will stay open, displaying the live log.

    • Example with a midnight blue background (-bg midnightblue) and sky blue text (-fg skyblue):
    • xterm -bg midnightblue -fg skyblue -geom 135x25+10+100 -e 'tail -f /home/littlegirl/.xsession-errors'
    • Example with a hot pink background (-bg '#FF00FF') and pastel pink text (-fg '#FFC0CB'):
    • xterm -bg '#FF00FF' -fg '#FFC0CB' -geom 135x25+10+100 -e 'tail -f /home/littlegirl/.xsession-errors'
  • To stop displaying the live log(s), close the Xterm window.

MultiTail


Obligatory Happy Ending

And they all lived happily ever after. The end.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Comment:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: