cmd 2>&1 > log vs cmd > log 2>&1 [duplicate]
Order matters. The way to reason about redirections is to read them from left to right and realize that redirections make streams point at the same place. They don’t make streams point at each other. What does that mean? If you say 2>&1 then you are redirecting stderr to wherever stdout is currently redirected to. … Read more