output redirection command

Dear All,

./waf --run scratch/myfirst > log.out 2>&1 

The above is a command line to redirect the output to a file called log.out.

what is the 2>&1 part for ?

Thank you

The syntax 2> instructs the shell to redirect standard error (file descriptor 2). The &1 is a reference to an open file descriptor (1) which is standard output. Therefore 2>&1 causes standard error to be redirected to the same file as standard output, so both stderr and stdout will be written, in your case, to log.out.

1 Like

oh alright Thanks !