This thread here discussed how to write terminal output to a file.
Suppose I run a Kafka consumer command in a terminal, using >> out.txt
to store the streamed data. Once the data stream is paused (not stopped) for some reason, the out.txt
is closed and never opened again (unless I rerun the command).
Are there any ways to keep this file open and waiting and appending indefinitely unless it is stopped manually (like with Ctrl-C)?
To clarify: this question is not about Kafka. For any command that produces indefinitely continuous output to a terminal in a non-stop manner, but for some reason, that stream of output is paused for a moment, the out.txt
is closed. That leads to the command stopping and it has to be rerun. Question: any way to keep the command waiting and appending to the same file out.txt
?