Real-World Examples
Example 1: Display TCP Connections to Port 22 (SSH):
ss -t sport = :22
This command specifically displays TCP connections with a source port of 22, which is typically associated with SSH connections. It helps you identify active SSH sessions.
Example 2: Show UDP Listening Ports:
ss -ul
This command lists all UDP sockets in the listening state, which is valuable for identifying open UDP ports on your system.
Example 3: Display Summary Statistics for TCP and UDP:
ss -s -t -u
Here, the command combines `-s` with `-t`and `-u` to provide summary statistics separately for TCP and UDP socket types, offering insights into the overall network usage on your system.
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.