If I use a command like this one: ./program >> a.txt & , and the program is a long running one then I can only see the output once the program ended. That means I ha
The unbuffer command from the expect package does exactly what you are looking for.
expect
$ sudo apt-get install expect $ unbuffer python program.py | cat -