I have a python program that makes some prints that I try to execute from the command line. I would like to redirect the output to a file and also see on the shell the prints. I tried cmd > file, cmd >> file and cmd &> file. But with these three commands, the prints are neither in the shell nor in the file. Why?
cmd 2>&1 | tee fileunbufferas mentioned in one of the answers in the linked question.