CTAIL(1) CTAIL(1) NAME ctail - watch multiple files grow in split windows SYNOPSIS ctail --help ctail --version ctail [OPTIONS] [settings] file [[settings] file ...] DESCRIPTION ctail is like running tail -f, but can be used on multiple files. It uses the Curses library to split the screen into as many windows as there are files to watch. The size of each file's window can optionally be specified on the command line. Regular expressions can be used to display only lines matching (or not matching) arbitrary criteria. Each file's window has a status bar, showing the file name, date and time of last change and current file size. To quit ctail, press [q] or [space] or [return]. The OPTIONS affect the operation of ctail as a whole, while the settings are applied only to the next specified file. OPTIONS --help Print usage information and exit. --version Print version information and exit. -d N Sets the debug level to N, which should be between 0 and 8. Default: 0 -r N Causes ctail to re-nice itself by N, which must be between 1 and 20. May help to avoid ctail taking up too much CPU time when used on fast-growing files. -t N Sets the time interval between checking the moni­ tored files for growth in seconds. Defaults to 1 second. Fractional seconds can be passed, using -t 0.5 for instance. SETTINGS These settings must be specified before their respective file name on the command line and only affect this next file. -e 'regex' Only display lines matching the given regular expression. Can be used in combination with -v and defaults to ^.*$ (match anything). -v 'regex' Do not display lines which match the given regular expression. Can be used in combination with -e and defaults to ^\s*$ (match empty lines, i.e. empty lines won't be shown). -w N Sets the weight for the respective file's window size. For example, if you run ctail on two files, but want the second one to take up two thirds of the screen, you could pass 1 as weight to the first file and 2 as weight to the second one. The default weight is 1. All regular expressions are in Perl style. Thus, if you want a regular expression to match case-insensitively, you just have to put (?i:...) parentheses around it. For exam­ ple, if you want only those lines displayed which include the word "error" regardless of its case (like "Error", "ERROR", etc.), you would use the ctail setting -e '(?i:error)'. EXAMPLES The following examples focus on how the various options and settings can be used; for simplicity, they work with only 2 files to watch at the same time. Note that you can use ctail on as many files as you want, as long as your screen has enough lines to display windows for all of them. Example 1: ctail -t 2.5 -r 10 /var/log/messages /var/log/fire­ wall Splits the screen into two equally sized windows (as no weights have been specified) to watch the two given logfiles grow. ctail will check every 2.5 seconds whether either of the logfiles has grown. On startup, it will renice itself by 10, i.e. it changes its operating system scheduling priority in favor of the other processes. Example 2: ctail -w 2 /var/log/messages -w 3 /var/log/firewall This time weights are given for both files' win­ dows. As the sum of all weights is 5, /var/log/mes­ sage's window will be granted 2/5 (40 percent) of the screen, while /var/log/firewall gets the other three fifths, i.e. 60 percent. Example 3: ctail -v 'last message repeated' /var/log/messages -e '(?i:drop)' /var/log/firewall Now, lines from /var/log/messages will not be shown if they include the phrase "last message repeated". Also, only those lines from /var/log/firewall will be displayed which contain "drop"; note that '(?i:drop)' is the case-insensitive equivalent of just 'drop'. NOTES ctail is able to handle files when they are truncated, deleted and re-created or turn temporarily unreadable. If a file does not exist when ctail is started, an empty window will be allocated for it, which will be filled as soon as the file is created. This is useful in many situa­ tions, but can be confusing when you've made a typo in the filename and wonder why nothing is ever shown. When run in a debug level of 2 or higher, ctail will print a warning if a file does not exist. BUGS ctail is a Perl script and thus might or might not match your performance requirements when working on fast-growing files. If it takes up too much CPU time on your specific machine, you might want to have a look at André Majorel's nifty wtail, which presently has less features but is written in C. All overhang lines are currently given to the last window; for example, if you have 62 lines on your display and use ctail on 3 files, then the first and second files will get 20 lines each and the third one gets 22. These 2 overhang lines should better be distributed among all windows equally. A workaround is to pass the weigths 21, 21 and 20 manually. AUTHOR Wolfgang Hommel URL: http://www.code-wizards.com/projects/ctail LEGAL ctail is copyright Wolfgang Hommel 2003. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. SEE ALSO tail(1), wtail(1) ctail 0.1 2003-01-12 CTAIL(1)