1 = stdout

2 = stderr

stdout to stderr


command abc  1>&2


stderr to stdout

command abc 2>&1


stdout to /dev/null and stderr to stdout

command abc 1>/dev/null 2>&1


stdout to file

command abc 1>file.out


stdout and err to file

command abc &>file.out


stdout and stderr to eternity

command abc &>/dev/null

Written by Knilluz on 5 March 2012 at 09:03