Advanced Filtering and Display Options
The ‘ss’ command offers more advanced options for filtering and customizing the displayed socket information.
Filter by Port:
To filter sockets based on a specific port number, you can use commands like this:
ss sport = :80
This command, for example, displays sockets with a source port of 80. It’s useful for pinpointing connections related to a particular service or port.
Display IPv6 Sockets:
If you need to view IPv6 sockets in addition to IPv4, use the `-6` option:
ss -6
This command allows you to see both IPv4 and IPv6 socket information.
Display Summary Statistics:
To obtain summary statistics about various socket types, utilize the -s option:
ss -s
Running this command provides a summarized overview of socket types, including their counts and various states.
ss command in linux
Linux is celebrated for its versatility and robust command-line utilities. One such utility is the ‘ss’ command, which stands for “Socket Statistics.” It is a potent tool for inspecting and displaying detailed information about network sockets on a Linux system. The ‘ss’ command is an indispensable resource for network administrators, system administrators, and developers, offering insights into network connections, routing tables, and more.
In this comprehensive guide, we’ll explore the ‘ss’ command, its various options, and use cases, and provide real-world examples to help you harness its full potential.