command > out.txt 2>&1

Category: I/O Redirection & Pipes

command > out.txt 2>&1

Redirect both stdout and stderr to the same file

Sends both normal output and error messages to the same file by first redirecting stdout to the file, then merging stderr into stdout.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.