Oftentimes I run into small bash scripts that use this sort of syntax in if statements:
some command > /dev/null 2>&1
What is the purpose of outputting to /dev/null
like that, and what does the 2>&1
mean?
It always seems to work but I'd like to know what it's doing.