ss is a network tool for displaying detailed information about network sockets, connections, and statistics. It provides a more advanced alternative to the netstat command and is often used for troubleshooting network issues, analyzing network performance, and monitoring network activity. The ss command supports a wide range of options and filtering criteria, making it a flexible and versatile tool for network administration.
Basic Syntax
ss [options]
Here, options are the various command-line options that can be used to specify the desired output format, filtering criteria, and other options.
Commonly Used Options
-
t: This displays information about TCP sockets. -
u: This displays information about UDP sockets. -
a: This displays information about all sockets, including listening sockets. -
n: This displays numeric addresses instead of resolving hostnames. -
p: This displays the process ID and name associated with each socket. -
e: This displays extended information about each socket. -
i: This displays information about network interfaces. -
r: This displays routing table information. -
o: This displays a timer based on the last packet received. -
h: This displays help information.
Useful Examples
-
ss: This displays a list of all open sockets. -
ss -t: This displays information about all TCP sockets. -
ss -u: This displays information about all UDP sockets. -
ss -a: This displays information about all sockets, including listening sockets. -
ss -n: This displays numeric addresses instead of resolving hostnames. -
ss -p: This displays the process ID and name associated with each socket. -
ss -e: This displays extended information about each socket. -
ss -i: This displays information about network interfaces. -
ss -r: This displays routing table information. -
ss -o: This displays a timer based on the last packet received. -
ss -t -n 'sport = :80': This displays information about all TCP sockets with a source port of 80. -
ss -t -n 'dport = :22': This displays information about all TCP sockets with a destination port of 22. -
ss -t -n 'state = established': This displays information about all TCP sockets that are in the established state. -
ss -l -p: This displays information about all listening sockets, including the process ID and name associated with each one.
Leave a Reply