2

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$

1 Answer 1

2

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
2
  • no, it not help
    – Alex
    Jun 7, 2013 at 9:06
  • -lntp doesn't work on Darwin's netstat. Mar 30, 2015 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .