Redirect a program’s standard output to both stdout and a file:

_$: program | tee /path/to/file

Redirect a program’s standard output and standard error to stdout and a file

_$: program 2>&1 | tee /path/to/file
_$: program |& tee /path/to/file    # Equivalent