ls > ls.out -- Send stdout of ls to ls.out mycmd > mycmd.out 2> mycmd.err -- Send stdout to mycmd.out, stderr to mycmd.err If you'd like stdout and stderr to go to the same location, use mycmd > mycmd.log 2>&1