1.

How Can I Redirect Both Stderr And Stdin At Once?

Answer»

command > file.log 2>&1 : Redirect stderr to "where stdout is currently going". In this case, that is a file opened in append MODE. In other words, the &1 reuses the file descriptor which stdout currently uses.

command 2>&1 | tee -a file.txt

command > file.log 2>&1 : Redirect stderr to "where stdout is currently going". In this case, that is a file opened in append mode. In other words, the &1 reuses the file descriptor which stdout currently uses.

command 2>&1 | tee -a file.txt



Discussion

No Comment Found