Where does the "No such file" error message go?
ls nosuchfile 2>&1 > out.txt
- To the terminal
- Into out.txt
- Into a file named 1
- Nowhere, it is lost
Redirections apply left to right:
Play Linux CLI ▸
2>&1 copies stderr to the terminal before stdout is moved to out.txt.