Redirect stdout to a new file

command > out.log

Redirect stdout while appending to an existing file

command >> out.log

Redirect stderr to a file

command 2> err.log

Redirect stderr while appending to an existing file

command 2>> err.log

Redirect both stdout and stderr to a file

command &> out.log

Redirect both stdout and stderr while appending to an existing file

command &>> out.log

Redirect both stdout and stderr to separate files

command 2> err.log 1> out.log

Redirect both stdout and stderr to separate files in append mode

command 2>> err.log 1>> out.log

Redirect both stdout and stderr to console and separate files in append mode

command 2>&1 | tee out.log