Tuesday, February 1, 2011

Real time monitoring of log files: Read from a file and print to the terminal stdout in Linux


1. If you need to write std out of a program log to a file

> program_command > logfile.log

2. and at the same time want to monitor it

> program_command | tee -f logfile.log

3. If you need to read from a log file  created by a running process onto your harddisk  in real time and stdout to terminal

> tail -f logfile.log

If you need to extract specific lines from the logfile
> tee -f logfile.log | grep 'your_specific_word'

4. Monitoring multiple job outputs in same window

Use multitail
http://www.vanheusden.com/multitail/features.html


OTHER LINKS
 A progress bar on your terminal
http://search.cpan.org/~fluffy/Term-ProgressBar-2.09/lib/Term/ProgressBar.pm






No comments:

Post a Comment