Sometimes this command just does not write content to a file by the ">" operator:
myprogram do --something > my-file-with-the-output.txt
Then you can you a small Linux default program called "tee". Example usage:
myprogram do --something | tee my-file-with-the-output.txt
Tee allows you also to use some option as "-a" to extend the file's content's instead of replacing them.