Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to figure out where my system's connections are being used (i.e. how many connections belong to what processes - could even be filtered by some expression through grep, if it applies). The system is running CentOS 6.

How can I determine what the connection usage is for a server?

share|improve this question
up vote 2 down vote accepted

The netstat command is what you are looking for:

$ netstat --all --programs --tcp --udp
share|improve this answer
Excellent! Running netstat --all --programs --tcp --udp | grep postgres | wc -l gives me all the PostgreSQL connections on that server, which is what I was looking for. Thanks! – Juan Carlos Coto Apr 17 '13 at 19:13

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.