############################### #output to pipe ############################### #ONLY STDERR goes to the pipe (each line accomplishes the same) vgs -o alltags > /dev/null | grep tags vgs -o alltags 3>&1 1>&2 2>&3 | grep tags #BOTH STDERR and STDOUT go to the pipe vgs -o alltags 3>&1 2>&3 | grep tags ############################### #output to file ############################### #stderr and stdout to same file #both outputs go to the same file cmd > /tmp/myfile 2>&1 #hide the output, sending it all to the bitbucket cmd > /dev/null 2>&1