Quote:
how about:
command 1>/dev/null 2>&1
it sends stdout to /dev/null and??
|
...sends stdandard error (stderr) to the same place where standard input (stdin) is going.
Note that the order matters: "command 2>&1 >/dev/null" doesn't work because stderr is first redirected to the same place as stdout, after that, stdout is redirected to /dev/null.
In the case of redirecting to /dev/null it does not matter much which form you use, but when you want to redirect both stdout and stderr to a single file, this doesn't work: "command >my_file.txt 2>my_file.txt"
but this does: "command >my_file.txt 2>&1"
These forms are exactly the same, only the syntax is different:
command >some_file 2>&1
command 1>some_file 2>&1
command &> some_file
command >& some_file
And I suppose the one you mentioned ("command 2&> some_file") belongs to this list as well.