Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an irritating problem: redirecting stderr does not work. I get:

iptables: Chain already exists

I can't be bothered to check if a chain exists already (pointless, iptables just throws an error if the chain exists before I flush it in the next step, so why bother checking if it already exists). In order to ignore this, I redirect stderr to /dev/null but this does not seem to work.

In general: how do I:

  1. check which stream is used by a command in bash? is this even possible?

  2. redirect ALL streams output by a command?

share|improve this question
Yikes! layman error: i was redirecting stderr before redirecting stdout: iptables -N droplist 2>&1 >/dev/null iptables: Chain already exists iptables uses stderr on error, "iptables -N droplist >/dev/null 2>&1" works. Nevertheless, the questions still stand I think. –  John Doe Jul 8 '13 at 10:42
You might be interested in "netstat -tnlp" –  Synthead Jul 24 '13 at 19:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.