Using tail -F to see a file changing in real-time Using tail -F to see a file changing in real-time shell shell

Using tail -F to see a file changing in real-time


while [ 1 ]; do sleep 1; clear; tail log.txt; done

This does not have the drawback of passing command and arguments to watch (sometimes you need to hop extra loops to make it correctly), and it clears the terminal.


Use this command.

watch tail -n 1 log.txt


You can watch command to monitor the file changes/difference (-d) every n seconds

watch -n 5 -d cat log.txt