Friday, September 11, 2015

2>&1

Have you asked yourself what 2>&1 means in a shell script? It means that 2 (stderr) is redirected to 1 (stdout). If you combine it with a redirect to /dev/null that line does not display any output or error messages. Example: apt-get update > /dev/null 2>&1