The output is something like the below:
# netstat --tcp --udp --listening --program
Active Internet connections (only servers)
| Proto | Recv-Q | Send-Q | Local Address | Foreign Address | State | PID/Program name |
| tcp | 0 | 0 | *:exec | *:* | LISTEN | 4284/xinetd |
| tcp | 0 | 0 | *:nfs | *:* | LISTEN | - |
| tcp | 0 | 0 | *:login | *:* | LISTEN | 4284/xinetd |
| tcp | 0 | 0 | *:53730 | *:* | LISTEN | 15445/oidldapd |
| tcp | 0 | 0 | *:shell | *:* | LISTEN | 4284/xinetd |
| tcp | 0 | 0 | *:1830 | *:* | LISTEN | 10930/emagent |
| tcp | 0 | 0 | *:33033 | *:* | LISTEN | 23649/java |