How do I open a text file in a terminal with instant auto-refresh every time it is changed?
I've looked at vim
with :set autoread
, but it requires some elementary input (such as a keypress inside vim
) to trigger the refresh.
I want the auto-refresh to be hands-free. Is there some hack to do this?
I'm using Crunchbang 11, but I'm quite comfortable with the terminal.
tail -f $file
. – jirib Nov 15 '13 at 13:48inotify
. Looking it up, it's an API that I need to access with C programming, which I'm not inclined to do anytime soon. I'm looking for a shell command solution. – Kit Nov 15 '13 at 13:57inotify-tools
. These use a feature built into the Kernel called inotify. Any time a file is acted upon an event is sent via inotify that you can act on. Many prog. langs. such as Python, Perl, etc. have libraries that wrap the Inotify API. See the Wikipedia pg: http://en.wikipedia.org/wiki/Inotify – slm Nov 15 '13 at 14:40