In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to quickly solve the port conflict under Windows and Linux. I hope you will gain something after reading this article. Let's discuss it together.
Netstat command description
The netstat command is a very useful tool for monitoring the TCP/IP network. It can display the routing table, the actual network connection and the status information of each network interface device. The command parameters are slightly different in Windows and CentOS systems.
Netstat command parameters under Windows system:
Netstat command parameters under CentOS system:
By comparing the command parameters of netstat in Windows and CentOS systems, we can see that on the display process number, the Windows system adds the-o parameter to display the process number, while the CentOS system adds the-p parameter to display the process number; so when using netstat to display the port connection, the commands under the Windows and CentOS systems are: netstat-ano and netstat-anp, respectively. These two commands are to show all port connections, if there are a lot of port connections, it is not convenient to find out whether the port we want exists. At this point, you need to add the port for more search and display. The command for search under Windows is findstr *, and the command for search under CentOS is grep * (here * use port number instead).
Check if the port is occupied
The command to check whether the port is occupied under Windows is netstat-ano | findstr "8088". If a program is already occupied, the execution result is as follows:
The command to check whether the port is occupied under CentOS is netstat-anp | grep "8083". If a program is already occupied, the execution result is as follows:
View the port-occupying applications through the process number
Netstat can only view the process number that occupies the port, so other commands are needed to query specific applications. For Windows systems, we use the command wmic process get name,executablepath,processid | findstr 2984 (2984 is the process number queried using netstat), as shown below:
For CentOS systems, we use the command ps-ef | grep 48963 (48963 is the process number queried using netstat), as shown below:
Java applications view the application path through the jps command
From the above, we can see that they are all Java applications, but the application paths are not listed in Windows systems as in CentOS systems, so you also need to use the command line tool jps 2984 (2984 is the process number queried by netstat) to view the Java application paths, as shown below:
You can see the information of the entire Java application with process number 2984 after executing the jps 2984 command. We can find user.dir = D:\ nexus-2.8.1-01-bundle\ nexus-2.8.1-01 to know the application path that occupies the port.
After reading this article, I believe you have a certain understanding of "how to quickly resolve port conflicts under Windows and Linux". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!
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.