Using ss

This show socket (ss) command is another command that you can use instead of the netstat command. Here are some examples:

ss -at

This lists (a)ll (t)cp ports.

ss -alt

This lists (a)ll (l)istening (t)cp ports.