Tail multiple log files in one terminal

Categories: 

Tags: 

Script to save as "multitail.sh' or whatever you like. Save it in "/home/username/scripts" or any other folder

$ vi multi-tail.sh
#!/bin/sh

# When this exits, exit all back ground process also.
trap 'kill $(jobs -p)' EXIT
 
# iterate through the each given file names,
for file in "$@"
do
    # show tails of each in background.
 tail -fn 10 $file &
done
 
# wait .. until CTRL+C
wait

Edit your .bashrc or your .profile (both inside your user folder, e.g. /home/username/.profile)

Add alias

alias tail='/home/username/scripts/multitail.sh'

Just type in the shell "tail filename1 filename2 filename3"

Source: http://www.thegeekstuff.com/2009/09/multitail-to-view-tail-f-output-of-m...