What about:
{ whereis python; date; who; } > test.txt
EDIT:
The designation {...}instructs bashto run these commands in the current shell, and not use a subshell, as it would be when using notation (...). It is slightly more efficient as it avoids creating a new process.
If you want to temporarily change the environment (working directory, variables, etc.) for comamnds, but the notation is (...)easier to use, since you do not need to manually return all the changes after that:
( whereis python; date; who ) > test.txt
source
share