Linux HOWTOs

About | Home | Search

HOWTO: multitail
Description: tail, but for multiple files with colorization and filters
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# MultiTail 6.0
# =============
# Prerequisites:
# ncurses

# Get it
test -f installed/multitail-6.0.tgz && mv -f installed/multitail-6.0.tgz .
test ! -f multitail-6.0.tgz &&

# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "multitail-*" -exec rm -r {} \;
tar xzvf ~/multitail-6.0.tgz
cd multitail-6.0
test $UID = 0 && chown -R root:root .

# Build it
make CONFIG_FILE=/usr/local/etc/multitail/multitail.conf

# Check the build (requires cppcheck)
make check

# Become root to install it

# Remove old files that may cause issues/duplicates
test -x /usr/bin/multitail && rm /usr/bin/multitail
find /usr/local/doc -maxdepth 1 -type d -name "multitail-*" \
 -exec rm -r {} \;
( cd /usr/local/man/man1 ; rm -f multitail.1 multitail.1.gz )
find /usr/local/share/doc -maxdepth 1 -type d -name "multitail-*" \
 -exec rm -r {} \;
( cd /usr/local/share/man/man1 ; rm -f multitail.1 multitail.1.gz )

# Install it
# (if you don't have/want/need coreutils' install, just use mkdir, cp,
# chmod, etc. instead)
install -m 0755 -s ./multitail /usr/local/bin/
install -d -m 0755 /usr/local/doc/multitail-6.0
install -m 0644 ./*.txt ./INSTALL ./manual*.html \
install -d -m 0755 /usr/local/etc/multitail
install -m 0644 ./multitail.conf /usr/local/etc/multitail/multitail.conf.dist
install -m 0644 ./convert-* ./colors-* /usr/local/etc/multitail/
gzip -cf9 ./multitail.1 > ./multitail.1.gz
install -m 0644 ./multitail.1.gz /usr/local/man/man1/

# To set up a new multitail.conf, copy the *.dist one to multitail.conf
test ! -f /usr/local/etc/multitail/multitail.conf &&
 cp -a /usr/local/etc/multitail/multitail.conf.dist \

# Become your non-root user again

# Save the source for later
mkdir -p -m 0700 installed
rm -f installed/multitail-*.tgz
mv multitail-6.0.tgz installed/

# If you ever want to uninstall multitail, this should do it:
test -d src/multitail-* && ( cd src/multitail-* ; make uninstall )
test -d /usr/local/doc/multitail-6.0 && rm -r /usr/local/doc/multitail-6.0
test -d /usr/local/etc/multitail && rm -r /usr/local/etc/multitail
rm -f /usr/local/bin/multitail /usr/local/man/man1/multitail.1.gz
find ~/src -maxdepth 1 -type d -name "multitail-*" -exec rm -r {} \;
rm -f ~/installed/multitail-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>