bash dev null only output code example
Example 1: 2> /dev/null
> file redirects stdout to file
1> file redirects stdout to file
2> file redirects stderr to file
&> file redirects stdout and stderr to file
2&1> file redirects stdout and stderr to file
/dev/null is the null device it takes any input you want and throws it away. It can be used to suppress any output.
Example 2: bash redirect output to null
command > /dev/null
#Example
echo "Hello World"
Hello World
echo "Hello World" > /dev/null
#Doesn't show anything