$ find / -name foo > output.txt
$ find / -name foo 2> /dev/null
$ find / -name foo > output.txt 2>&1
OR
$ find / -name foo > output.txt 2> output.txt
find -name test.sh 2>&1 | tee /tmp/output2.txt