Open a text file in a terminal and auto-refresh it whenever it is changed

This should show you the file once per second:

watch -n 1 cat file

tail -f /var/log/syslog

Shows the syslog updates as they are added to the file.


I would use watch as the other answer suggests but just to show you how one can approach a seemingly complicated problem using the building blocks provided by a shell such as Unix; a while loop can be a simple way to perform your looping.

$ while [ 1 ]; do clear; date; cat <afile>; sleep 1 ;done

Example

$ while [ 1 ]; do clear; date; cat sample.txt; sleep 1 ;done
Fri Nov 15 09:17:39 EST 2013
1
2
3
4
5

The screen clears and then after a second, this gets displayed:

Fri Nov 15 09:17:40 EST 2013
1
2
3
4
5

Tags:

Text

Terminal