Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Inside OSX(10.8.3) netstat show listen socket on port but lsof don't:

> iMac:callsfreecalls-apple alex$ lsof -Pnl +M -i4|grep 5060
> iMac:callsfreecalls-apple alex$ sudo netstat -lntp udp|grep 5060
> Password: udp4   18546      0  *.5060                 *.*

please advice.

sudo isn't help:

> server:sites alex$  
> server:sites alex$ ssh 192.168.0.58 Password: Last
> login: Tue Jun  4 10:26:04 2013 
> iMac:~ alex$ sudo lsof -Pnl +M -i4 |
> grep 5060 Password: 
> iMac:~ alex$ netstat -lntp udp | grep 5060 udp4  
> 18546      0  *.5060                 *.*                              
> iMac:~ alex$
share|improve this question
add comment

1 Answer

You need sudo with lsof to see other users' processes (OTOH you don't need sudo with netstat):

$ netstat -lntp udp | grep 5353
udp6       0      0  *.5353                                        *.*                                                      
udp4       0      0  *.5353                 *.*                               
$ lsof -Pnl +M -i4 | grep 5353    # Won't work
$ sudo lsof -Pnl +M -i4 | grep 5353    # Will work
mDNSRespo 94183       65    8u  IPv4 0xca78f18f22d6d11b      0t0  UDP *:5353
share|improve this answer
    
no, it not help –  Alex Jun 7 '13 at 9:06
add comment

Your Answer

 
discard

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.