Output file contents while they change
You can use tail command
with -f
:
tail -f /var/log/syslog
It's good solution for real time show.
If you want to show a short file, that fits on one terminal screen,
and what is changing is possibly the whole file, you could use watch
:
watch cat example.txt
Every 2.0s: cat example.txt Sun Aug 3 15:25:20 2014
Some text
another line
It shows the whole file every 2 seconds by default, including an optional header:
The option -d
(--differences
) will highlight changes from previous version of the output, or from the first version.
less
has a follow mode similar to tail -f
- just hit F
when you have it open.