Command Monitoring – How to Follow a Command Like tail -f

monitoringpipetail

I have a script which produces a file 'Detail.out'. I know that the script is completed whenever the file contains a certain number of lines (roughly 21025). So I find myself sitting at the command prompt running:

[me@somewhere myDir]$ wc -l */Detail.out
  21025 A/Detail.out
  21025 B/Detail.out
  21025 C/Detail.out
  12995 D/Detail.out
  10652 E/Detail.out
   3481 F/Detail.out
  21027 G/Detail.out
  21025 H/Detail.out
  21025 I/Detail.out
  ...   ...

I've used tail -f to watch a specific file, but I'd like to follow the output of the wc -l */Detail.out command shown above. Is this possible? I'm currently using tcsh in Ubuntu 11.04 if that matters.

Best Answer

Try the watch command, although I suspect just about everyone has written their own version at one time or another. (The cheapie version is while :; do clear; "$@"; sleep 5; done.)

Related Question