There are three standard file descriptors: Standard Input, stdin (0); Standard Output, stdout (1); and Standard Error, stderr (2). '> foo' redirects stdout (fd 1) to the file 'foo'. '2>&1' duplicates stderr (fd 2) onto stdout (fd 1) which has already been redirected to the file 'foo'.
Edit: Note that the ordering is important.
Edit: Note that the ordering is important.
Statistics: Posted by dickon — Tue Jan 07, 2025 8:28 pm