2

I have a command that processes data slowly. The command processes lines from a file and writes the results to the output file data.txt:

my_command > data.txt

The issue I have is that I'd like to examine output lines in the data.txt file as they are processed. The problem is that no output appears in my output file until the OS decides to dump data to the output file, which happens every few hours. Is there anyway I can force data to be flushed to the file more frequently?

turtle
  • 2,697
  • 5
  • 20
  • 17

1 Answers1

2

One option is to unbuffer your command's stdout using stdbuf from GNU Coreutils. I doubt I would be able to explain the technicalities behind it any better than the author does here

iruvar
  • 16,725