Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

An application may be binding multiple sockets to a specific port,how can I get those sockets command line?

share|improve this question
up vote 11 down vote accepted

lsof will also provide you with information about open sockets:

$ lsof -i TCP:17500        
Dropbox 244 username  19u  IPv4 0x05584748      0t0  TCP *:17500 (LISTEN)
share|improve this answer
what does 19u mean? – kernel Jun 20 '11 at 10:36
@kernel, is the File Descriptor number of the file. "u" means r+w access. man lsof :) – Francisco Jun 20 '11 at 10:48

Netstat can provide you this information :

petrus@srv:~$ sudo netstat -taunp
Connexions Internet actives (serveurs et établies)
Proto Recv-Q Send-Q Adresse locale          Adresse distante        Etat        PID/Program name
tcp        0      0*               LISTEN      7837/munin-node 
tcp        0      0    *               LISTEN      6399/sshd       
udp        0      0 *                           9639/rpc.statd  
udp        0      0   *                           9639/rpc.statd  

Output shortened for clarity.

share|improve this answer
I swear, I've never seen a Unix system speaking FRENCH before! – Massimo Jun 20 '11 at 6:46
@Massimo: well, mine does :) – petrus Jun 20 '11 at 8:35

If you are using *bsd system (I don't know if it exist for linux and other *nix), there is this socksat command, which does what you are looking for.

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.