$ netstat -an|grep LISTEN|sort tcp4 0 0 *.3951 *.* LISTEN tcp4 0 0 *.5432 *.* LISTEN tcp4 0 0 127.0.0.1.1033 *.* LISTEN tcp4 0 0 127.0.0.1.631 *.* LISTEN tcp6 0 0 *.5432 *.* LISTEN $ sudo /usr/sbin/lsof -i:5432 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME postgres 180 postgres 5u IPv6 0x02feac50 0t0 TCP *:postgresql (LISTEN) postgres 180 postgres 6u IPv4 0x039eee8c 0t0 TCP *:postgresql (LIST