There are three I/O devices available on the command line:
1.standard input - 0
2.standard output - 1
3.standard error - 2
command > file.log
command >> file.log
command 2> file.log
command 2>> file.log
command > file.log 2>&1
This sends 2 (standard error) into 1 (standard output), and sends standard output to file.log
Notice that it's also possible to redirect standard input into a command that expects standard input
command << file.txt
./command >/dev/null
./command >/dev/null 2>&1
./command >/dev/null 2>&1 &
For more details, check out the Advanced Bash Scripting Guide.
note: this is collected from answer given here.