In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to use the ss command to check the network connection in Linux. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Ss is part of the iproute2 package (a tool that controls TCP/IP networks and traffic). The goal of iproute2 is to replace the standard Unix network tool suite (commonly referred to as "net-tools") that was previously used to configure network interfaces, routing tables, and manage ARP tables. The ss tool is used to export socket statistics, which can display information similar to netstat, as well as more TCP and status information. Because it gets information directly from kernel space, it will be faster. Ss operates much like netstat, so this makes it easy to replace netstat.
Use and common options
Ss is much like netstat in that by default it displays a list of open non-listening TCP sockets that have established a connection. And you can filter the output with the following options:
-n-do not try to resolve the service name.
-r-attempts to resolve the address / port of the number.
-a-displays all sockets.
-l-displays the listening socket.
-p-displays the processes that use the socket.
-s-print statistics
-t-only TCP sockets are displayed.
-u-only UDP sockets are displayed.
-d-shows only DCCP sockets
-w-only RAW sockets are displayed.
-x-shows only Unix domain sockets
-f FAMILY-displays the type of FAMILY socket. The following families are currently supported: unix, inet, inet6, link, netlink.
-A QUERY-specifies the list of sockets to list, separated by commas. The following identifiers can be recognized: all, inet, tcp, udp, raw, unix, packet, netlink, unixdgram, unixstream, packetraw, packetdgram.
-o STATUS-lists sockets in the specified state
Example of ss command
1. Show all TCP ports and the processes that use them:
The code is as follows:
# ss-tnap
two。 You can use the-4 flag to display IPv4 links and the-6 flag to display IPv6 links, such as:
The code is as follows:
# ss-tnap6
3. As in the above behavior, you only need to use u instead of t and all open UDP ports will be displayed.
The code is as follows:
# ss-unap
4. You can use the-s flag to print all kinds of useful statistics:
The code is as follows:
# ss-s
5. You can use the-o flag to check all links in different states, such as displaying all established connections.
The code is as follows:
# ss-tn-o state established-p
The above is how to use the ss command to check the network connection in Linux. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.