Saturday, February 5, 2011

Linux Command

watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds; use -n or --interval to specify a different interval.

To watch for mail, you might do

watch -n 60 from

To watch the contents of a directory change, you could use

watch -d ls -l

To watch mysql replication

watch -n -3 "mysql -u root -e 'show slave status\G;'"

To watch the increasing size of a file

watch -n -3 'ls -alh'

AWK--- Finds lines in files that match a pattern and performs specified actions on those lines

The tail command reads the final few lines of any text given to it as an input and writes them to standard output (which, by default, is the monitor screen).


tail -f /var/log/squid/access.log | awk '{print $3" " $4 " "$7}'

192.168.x.x TCP_MISS/200
192.168.x.x TCP_MISS/200
192.168.x.x TCP_MISS/200
192.168.x.x TCP_HIT/200

1 comment:


Check Page Rank of your Web site pages instantly:

This page rank checking tool is powered by Page Rank Checker service