In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Practical Linux to see what the method of port occupation is, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, hope you can gain something.
How to check whether the port is occupied in the Linux system? If you want to view the port in the Linux system, you can use the command netstat to view it. I will explain the specific practical methods of netstat in Linux in detail.
1.netstat-anp | grep port number
As follows, let me take 3306 as an example, netstat-anp | grep 3306 (note here, I operate as an ordinary user, so add sudo. If you operate as a root user, you can view it without adding sudo), as shown in figure 1:
Figure 1
In figure 1, the monitoring status of LISTEN indicates that it has been occupied, and the last column shows that it is occupied by the service mysqld. Check the specific port number. As long as the line as shown in the figure indicates that it is occupied.
2.netstat-nultp (no port number is added here)
This command looks at all the ports that are currently in use, as shown in figure 2:
Figure 2
You can see in the picture that my port 82 is not occupied.
3.netstat-anp | grep 82 to view the usage of port 82, as shown in figure 3:
Figure 3
You can see that there is no LISTEN line, so it means it is not occupied. Note here that the LISTENING shown in the figure does not mean that the port is occupied. Do not be confused with LISTEN. When viewing a specific port, you must see the line tcp, port number and LISTEN to indicate that the port is occupied.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.