The ss command is a replacement for netstat command. This command gives more information in comparison to the netstat. It is also faster than netstat as it gets all information from kernel userspace.
Look at the above snapshot, ss command displays all TCP, UDP and socket connections.
Listing listening and connected ports of TCP, UDP and Unix
If you want to list connected as well as listening ports for TCP, UDP and Unix use -t, -u and -x respectively with a command.
Listing listening Ports of TCP, UDP and Unix
If you want to list listening ports for TCP, UDP and Unix use -t, -u and -x respectively with l command.