Write error output to a separate file.
Section: Redirection
Redirect stderr to file
bash
bash
grep needle missing.txt 2> errors.logExplanation
File descriptor 2 is stderr.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Redirection