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.
nc -q -1 local host ${PORT} ${CMD}

In Ubuntu, nc may be used as above, with the -q option. See manpage.

  • -q after EOF on stdin, wait the specified number of seconds and then quit. If seconds is negative, wait forever.

However, this option is not available in Redhat 5. See manpage. How do I achieve the equivalent of nc -q in Redhat 5?

share|improve this question

1 Answer 1

What do you want that option for? If you explain the use case, maybe we can come up with an alternative.

For example, maybe

while 1; do
    nc localhost ${PORT}

is sufficient?

I think the linux.die.net man pages is from RHEL5, but not 100% sure.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.