I run a build from a script and want everything in one log. make > build.log 2>&1 captures both normal output and errors, but make 2>&1 > build.log still prints the errors on the terminal. I have also seen &> build.log and 2>&1 | tee build.log.
What does 2>&1 literally mean, why does the order matter, and which form should I use?




