Armazene toda a saída do terminal em um arquivo

SomeCommand 2>&1 | tee SomeFile.txt
Chinmay Manas