I know I can redirect all terminal output to a file, but does that work the other way around?
Can I have a terminal window open, in Tmux or elsewhere, that is receiving redirected output from a file in real time? IE if another process is writing to the file, this is being directed to a terminal window?
Use case: REPL swamped by output
The reason I would like this is I would like to see the output of some code in a REPL (Erlang it turns out) which has many processes creating terminal output stuff in background, but this output is very rapid and I "lose" my REPL command line constantly as it is drowned by the output. So I'd like those processes to output to a file instead, but, in another terminal, I still want to see what that output is in real time.
tail -f
is what I was looking for.now in another terminal:
Works a charm. Now some programs (vim for example) will close and reopen the file and
tail -f
will not work, so you will not see additions when you save from vim. In this case, usetail -F
, which explicitly follows the filename rather than the descriptor.