tail -f for multiple files

Is there a way to view the log progress from multiple files.

For eg: I have 10 log files from 10 different instances. Instead of opening 10 terminal and doing tail -f on each, is it possible to view all the log changes in one tail -f?
Say I have file1,file2 .. file10

I have tried

tail -f file*

No luck:(

This is showing only the first log progress.

Thanks in advance.

No you can't tail -f on more than one file. What you can do is use screen to open more terminals in one terminal and then navigate to the other terminals where you can see you logs.

Hi,

perhaps this is not exactly what you want, but try to put all but the last into background:

$ tail -f file1 &
$ tail -f file2 &
...
$ tail -f filen

To stop the tails you can successive put them into foreground with "fg" and stop them.

best regards
Andreas

if you are on linux it support mult file tail

tail -f filename -f filename

Or use the below script.

#!/bin/sh

trap 'kill $(jobs -p)' EXIT

for file in "$@"
do

	tail -f $file &
done

wait
1 Like

There is multitail.

http://www.vanheusden.com/multitail/

Though I havent used it.

You will need to install that ,

adding to the thread ,

i think multiple tailing files comes with RHEL5 . i have that one . and am able to see tailed text for both the files. But is there any option is there so that i can switch to files or i can stop one in run time ..

Just came to mind while reading the thread.....

I'm using REHEL 5 and the multiple file tailing does not work in the same time .. how can you tail 2 files and show them both in the same time on juste one terminal ?

I am currently on Ubuntu.
I installed multitail using

sudo apt-get install multitail

Then tried it out

shell>multitail file1 file2

It displayed both files on the same terminal. There are screen shots here

http://www.vanheusden.com/multitail/
1 Like

Cool thanks for the info.. I'll give it a try.