25.18 Watching Several Files GrowNow here's a useful tool: suppose you want to monitor several files at once. Administrators, for example, might want to keep track of several log files, such as /usr/adm/messages , /usr/adm/lpd-errs , UUCP error files, etc.
For example, suppose you want to perform several grep s through many files, saving the output in different files. You can then monitor the files using xtail . For example: % When new text appears in the files called with xtail , it also appears on the screen: *** SysV.grep *** ch01:using a SysV-based UNIX system, you must *** Berkeley.grep *** ch01:at the University of California at Berkeley, where *** BSD.grep *** ch03:prefer BSD UNIX systems because they are less likely to ch04:who use a BSD-based UNIX systems must run the *** SysV.grep *** ch04:is a SysV derivative sold by Acme Products Inc. (When text is written to a new file, the filename is printed
surrounded by If you press your interrupt key (5.9 ) (usually CTRL-c or DEL), xtail will tell you which files have been modified most recently: [CTRL-c] *** recently changed files *** 1 4-Nov-92 18:21:12 BSD.grep 2 4-Nov-92 18:19:52 Berkeley.grep 3 4-Nov-92 17:42:45 SysV.grep To exit xtail , you must send the QUIT signal (usually CTRL-\, control-backslash). If an argument given to xtail is a directory name and not a filename, then xtail monitors all files in that directory. For administrators, this comes in very useful for monitoring the UUCP (1.33 ) log files in all the subdirectories of /usr/spool/uucp/.Log : % - |
|