Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a 'logs' directory full of log files whose names follow this format:

XXX-YYYY-DATE-N.txt

where N is a number that grows bigger as time goes on.

So for example right now I have:

xxx-yyy-20130226-20.txt
xxx-yyy-20130226-21.txt
xxx-yyy-20130226-22.txt

I'd like to monitor these files, so I can see the latest one and scroll back to earlier ones transparently.

The multitail docs say

It can also monitor wildcards: if another file matching the wildcard has a more recent modification date, it will automatically switch to that file. That way you can, for example, monitor a complete directory of files. Merging of 2 or even more logfiles is possible.

So multitail seems to be exactly what I want in this case.

I've read the docs, but I can't figure out the correct incantations to have it do exactly what I said above: show me the latest log matching a pattern, and merge all of them so I can scroll back.

Could you please help?

share|improve this question
up vote 0 down vote accepted

I’ve never heard of this program today, but a quick look at the man page suggests that you want to say -iw "xxx-yyy-*.txt" 5, replacing the 5 with the interval –– how often you want it to check whether any new files were created.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .