I always used netstat and reading the man page I see it is now saying that it is being replaced by ss. ss seems to behave weirdly though. I am running apache and it is not showing up as listening:
[www3 ~]# ss -aptls4n
Total: 171
TCP: 17 (estab 8, closed 1, orphaned 0, timewait 0)
Transport Total IP IPv6
RAW 0 0 0
UDP 24 16 8
TCP 16 13 3
INET 40 29 11
FRAG 0 0 0
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 0 127.0.0.1:953 0.0.0.0:* users:(("named",pid=2824,fd=22))
LISTEN 0 0 0.0.0.0:25 0.0.0.0:* users:(("smtpd",pid=27093,fd=6),("smtpd",pid=27051,fd=6),("smtpd",pid=27049,fd=6),("master",pid=2731,fd=13))
LISTEN 0 0 10.0.0.37:2222 0.0.0.0:* users:(("sshd",pid=2958,fd=3))
LISTEN 0 0 10.0.0.37:53 0.0.0.0:* users:(("named",pid=2824,fd=25))
LISTEN 0 0 96.57.23.83:53 0.0.0.0:* users:(("named",pid=2824,fd=24))
LISTEN 0 0 127.0.0.1:53 0.0.0.0:* users:(("named",pid=2824,fd=23))
[www3 ~]#
with ip6 it shows up.
[www3 ~]# ss -aptlsn6
Total: 171
TCP: 17 (estab 7, closed 1, orphaned 1, timewait 0)
Transport Total IP IPv6
RAW 0 0 0
UDP 24 16 8
TCP 16 13 3
INET 40 29 11
FRAG 0 0 0
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 0 *:80 *:* users:(("/usr/local/apac",pid=27020,fd=4),("/usr/local/apac",pid=26994,fd=4),("/usr/local/apac",pid=26990,fd=4),("/usr/local/apac",pid=26867,fd=4),("/usr/local/apac",pid=26525,fd=4),("/usr/local/apac",pid=26507,fd=4),("/usr/local/apac",pid=26504,fd=4),("/usr/local/apac",pid=26204,fd=4),("/usr/local/apac",pid=25920,fd=4),("/usr/local/apac",pid=23430,fd=4),("/usr/local/apac",pid=13542,fd=4))
LISTEN 0 0 *:53 *:* users:(("named",pid=2824,fd=21))
[www3 ~]#
if shows up with netstat
[www3 ~]# ss -aptlsn6
Total: 171
TCP: 17 (estab 7, closed 1, orphaned 1, timewait 0)
Transport Total IP IPv6
RAW 0 0 0
UDP 24 16 8
TCP 16 13 3
INET 40 29 11
FRAG 0 0 0
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 0 *:80 *:* users:(("/usr/local/apac",pid=27020,fd=4),("/usr/local/apac",pid=26994,fd=4),("/usr/local/apac",pid=26990,fd=4),("/usr/local/apac",pid=26867,fd=4),("/usr/local/apac",pid=26525,fd=4),("/usr/local/apac",pid=26507,fd=4),("/usr/local/apac",pid=26504,fd=4),("/usr/local/apac",pid=26204,fd=4),("/usr/local/apac",pid=25920,fd=4),("/usr/local/apac",pid=23430,fd=4),("/usr/local/apac",pid=13542,fd=4))
LISTEN 0 0 *:53 *:* users:(("named",pid=2824,fd=21))
[www3 ~]# netstat -tapvWenof
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name Timer
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 0 19935 2824/named off (0.00/0/0)
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 0 19760 2731/master off (0.00/0/0)
tcp 0 0 10.0.0.37:2222 0.0.0.0:* LISTEN 0 15332 2958/sshd off (0.00/0/0)
tcp 0 0 10.0.0.37:53 0.0.0.0:* LISTEN 0 19933 2824/named off (0.00/0/0)
tcp 0 0 96.57.23.83:53 0.0.0.0:* LISTEN 0 19928 2824/named off (0.00/0/0)
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 0 19923 2824/named off (0.00/0/0)
tcp 0 0 96.57.23.83:25 37.49.225.24:5875 ESTABLISHED 73 3053913 27051/smtpd keepalive (6902.57/0/0)
tcp 0 0 96.57.23.83:25 37.49.225.24:7251 ESTABLISHED 73 3055657 27049/smtpd keepalive (6910.32/0/0)
tcp 0 0 96.57.23.83:25 37.49.225.24:8407 ESTABLISHED 73 3054927 27093/smtpd keepalive (6954.37/0/0)
tcp 0 220 10.0.0.37:2222 10.0.0.62:33312 ESTABLISHED 0 3049257 26836/sshd: root@pt on (0.21/0/0)
tcp 0 0 10.0.0.37:2222 10.0.0.62:60328 ESTABLISHED 0 2893509 13149/sshd: root@pt keepalive (514.74/0/0)
tcp 0 0 10.0.0.37:2222 10.0.0.62:50142 ESTABLISHED 0 25466 3298/sshd: ruben [p keepalive (3177.14/0/0)
tcp 0 0 10.0.0.37:2222 10.0.0.62:50446 ESTABLISHED 0 53953 15315/sshd: root@pt keepalive (6740.66/0/0)
tcp6 0 0 :::80 :::* LISTEN 0 142886 13542/httpd off (0.00/0/0)
tcp6 0 0 :::53 :::* LISTEN 0 19916 2824/named off (0.00/0/0)
tcp6 0 0 96.57.23.83:80 103.231.63.185:25496 SYN_RECV 0 0 - on (8.50/4/0)
tcp6 0 0 96.57.23.83:80 103.231.63.92:41069 SYN_RECV 0 0 - on (0.26/1/0)
tcp6 0 0 96.57.23.83:80 103.231.60.209:44528 SYN_RECV 0 0 - on (5.54/3/0)
tcp6 0 0 96.57.23.83:80 46.229.168.142:3844 TIME_WAIT 0 0 - timewait (54.47/0/0)
tcp6 0 0 96.57.23.83:80 103.231.60.23:34593 SYN_RECV 0 0 - on (20.02/5/0)
tcp6 0 0 96.57.23.83:80 103.231.61.46:61719 SYN_RECV 0 0 - on (1.46/4/0)
tcp6 0 0 96.57.23.83:80 103.231.60.116:13910 SYN_RECV 0 0 - on (0.00/5/0)
tcp6 0 0 96.57.23.83:80 103.231.62.162:40483 SYN_RECV 0 0 - on (27.06/5/0)
tcp6 0 0 96.57.23.83:80 103.231.61.139:33626 SYN_RECV 0 0 - on (13.62/5/0)
tcp6 0 0 96.57.23.83:80 103.231.62.255:20547 SYN_RECV 0 0 - on (6.58/5/0)
netstat: feature `AF BLUETOOTH' not supported.
Please recompile `net-tools' with newer kernel source or full configuration.