Monitoring connections using the ss command

Alongside the IP command, we also have the ss command (Socket Statistics). This command is the perfect replacement for the netstat command and offers more functionality, it is also faster and gives results that are more accurate.

The following recipes offer some alternatives that should allow you to replace the venerable netstat command.

Getting ready

No additional configuration should be required as the IP tools come preinstalled in major Linux distributions (RHEL and Debian based).

How to do it…

Let's monitor network details using the ss command:

  1. You can use the following command to show established TCP connections:
    ss -t
    

    This should produce an output similar to the following screenshot:

  2. Alternatively, if ...

Get Learning DevOps: Continuously Deliver Better Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.