The entries must be read from right to left:
means: copy the file descriptor to which 1 is pointing to 2, i.e. the stderr will go to the stdout. Then the:
will copy the file descriptor from
logfile.txt to 1, i.e. stdout is written to the file. Often it’s used in the reverse order to combine
stdout and
stderr.
The
tee command will then append the original
stderr (which is now going via the
stdout descriptor) to the file
logfile.txt.
Unless there would be a huge delay because of the
tee command, there should be no race condition where both redirections will write at the same time to the file.