I am running a small cli python app in terminal. It loops infinitely and outputs text to the terminal. I want to output the text to a file, and I can do that with the following command
python [my cli app] >> log.txt, but I have to break the loop first before the file is closed and effectively saved. Is there a way to read the latest contents from the text file while the loop keeps running in the background?
~ $ [INFINITE LOOP] >> log.txt
then while thats running forever, I want to access
At the moment, it only saves the terminal output to the file once I stop the command with Ctrl+C.
I hope that explains it