"tail -f" alternate which doesn't scroll the terminal window
Posted
by
Jagtesh Chadha
on Stack Overflow
See other posts from Stack Overflow
or by Jagtesh Chadha
Published on 2011-01-13T06:43:51Z
Indexed on
2011/01/13
6:53 UTC
Read the original article
Hit count: 149
I want to check a file at continuous intervals for contents which keep changing. "tail -f" doesn't suffice as the file doesn't grow in size.
I could use a simple while loop in bash to the same effect:
while [ 1 ]; do cat /proc/acpi/battery/BAT1/state ; sleep 10; done
It works, although it has the unwanted effect of scrolling my terminal window.
So now I'm wondering, is there a linux/shell command that would display the output of this file without scrolling the terminal?
© Stack Overflow or respective owner