In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use the Netstat command in the linux system, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The Netstat command is used to display a variety of network-related information, such as network connections, routing tables, interface status (Interface Statistics), masquerade connections, multicast members (Multicast Memberships), and so on.
1-check all connections
Use the an option to list all connections in the system, $netstat-a
This shows all tcp, udp, and unix connections to the system.
2-check all tcp/udp/unix socket connections
Use the t option to list only tcp connections, $netstat-at
Similarly, use the u option to list only udp connections, $netstat-au
Use the x option to list only Unix socket connections, $netstat-ax
3-also lists the process ID/ process name
Use the p option to display the PID or process name while listing the connections, and it can also be used with other options, $netstat-ap
4-list the port number instead of the service name
Use the n option to speed up the output, which does not perform any reverse queries, but outputs numbers directly. Since no query is required, the output of the results is much faster. $netstat-an
5-output only listening port
Use the l option to output only the listening port. It cannot be used with the an option, because an outputs all ports, $netstat-l
6-output network statu
Use the s option to output statistics for each protocol, including the number of packets received / sent, $netstat-s
7-output Nic status
Use the I option to display only the statistics of the network card, $netstat-I
8-display Multicast Group multicast group information
Use the g option to output multicast group information for IPV4 and IPV6, $netstat-g
9-displays network routing information
Use r to output network routing information, $netstat-r
10-continuous output
Use the c option to continuously output the result $netstat-c
11-filter out a port
Connect with grep to filter out a port connection, $netstat-anp | grep 3306
12-count the number of connections
In conjunction with the wc and grep commands, you can count the number of connections to a specified port $netstat-anp | grep 3306 | wc-l
This outputs the number of connections to the mysql service port (that is, 3306).
The above is all the contents of the article "how to use Netstat commands in linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.