Linux – How to monitor changes across several files in Linux

bashlinuxunix

I want to monitor changes across several log files in Linux. Basically, I want to see which log file gets updated out of a set of 20 files. I have checked multitail tool, but its UI can handle max up to 5 files.

Any help is appreciated.

Best Answer

For what you propose, there's a lot of ways to do that depending on the situation.

Lightweight: Look into inotify

More fixtured (daemon): fam (File Alteration Monitor)

Or if it's not a common thing you'll be doing:

Or for a one off: watch -d -n 1 ls -t in the directory you want to watch (only in a flat directory, not recursive but you could modify it to do so) - then run tail on the result.