The problem with tail -f
tail -f is very useful to see real-time addition to log files. It allows watching all log files in specified folders, example:
tail -f abc.log mydir/*.log
abc.logis ignored forever if it does not exist at the moment the command is launched (which is most of the time, since I usually delete all log files before launching the
*only expands at launch time, which means that if after 5 minutes a new file appears in the directory, it is ignored.
- Take file path(s) and folder path(s) as input
- Output the content of these text files as soon as the content appears (as fast as possible)
- For folders, keep checking whether new files have been created in them
- For files that do not exist yet, keep checking whether they have been created
- Free and open source
- Bonus if maintained deb/rpm packages are available, double bonus if present in major distributions' channels.
Tailing several files could result in such output for instance if a.log is written then b.log then a.log again:
==> a.log <== bla1 bla2 ==> b.log <== blb1 blb2 ==> a.log <== bla3 bla4
This is how
tail does it, but similar formatting is OK too.