Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.