#send stderr to stdout echo test 2>&1 #send stdout to msg.txt file and stderr to err.txt command 1>>msg.txt 2>>err.txt #send stderr to stdout and send all to result.txt file command &>> result.txt command 2>&1&>> result.txt