Similar to my last question: Open a text file and let it update itself; is there a way I could do the same but for a folder instead?As I have a log folder, can I use tail -f with a folder?i.e.$ tail -f /tmp/logs/I know that this won't work, but is there an alternative?I am using RHEL 5.10
Open a directory and let it update itself using tail -f
directory;monitoring;tail
Yes there is an alternative, after a bit of research, I saw that you can use:$ watch ls -lYou need to be in the folder you want to watch.Also, you can use tail -10 at the end:$ watch ls -l | tail -10The command types ls every 2 seconds and filters the output to the last 10 files.If you read the reference link, it has some great tips, also if you can't remember the above command, then you can add the following to your .bashrc file:alias taildir='watch ls -l | tail -10'So you can just type taildir instead of writing the full command out again.Reference: How to Tail A Directory.