https://community.unix.com/t/difference-between-2-1-and-2-1/392167
I was reading this post.
ls name 2>&1 makes bash run ls with its stderr assigned to the same stream as its stdout (not the other way around, as you state).
Saw this. I'm wondering how is that different in a higher level of abstraction? Don't both throw their results in same file and that's all that matters?
2>&1 > foo
is not going to be the same as1>&2 > foo
– muru Oct 05 '23 at 03:482>&1
on a command, then that command's stdout and stderr will both go to file1.txt (the one that was just stdout), not to file2.txt (the one that was stderr). That's the distinction that's being made. – Gordon Davisson Oct 05 '23 at 04:58