I have never been able to figure out whether the port is occupied. After asking many people, I finally figured it out. Now let me summarize: 1.netstat -anp |grep port number As follows, I take 3306 as an example, netstat -anp |grep 3306 (note here, I am operating as a normal user, so I added sudo. If you are operating as a root user, you can view it without adding sudo), as shown in Figure 1: Figure 1 In Figure 1, the monitoring status is LISTEN, which means it is occupied. The last column shows that it is occupied by the service mysqld. Check the specific port number. As long as there is a line like the one in the figure, it means it is occupied. 2.netstat -nultp (no need to add port number here) This command is used to view all currently used ports, as shown in Figure 2: Figure 2 As you can see from the picture, my port 82 is not occupied. 3.netstat -anp |grep 82 to check the usage of port 82, as shown in Figure 3: Figure 3 It can be seen that there is no LISTEN line, so it means that it is not occupied. Note that the LISTENING in the figure does not mean that the port is occupied. Do not confuse it with LISTEN. When checking the specific port, you must see the line of tcp, port number, and LISTEN to indicate that the port is occupied. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: JavaScript style object and CurrentStyle object case study
>>: Detailed tutorial on deploying Django project using Docker on centos8
Install MySQL under Windows for your reference. T...
Recently, there has been a growing demand for imp...
Table of contents 1. We found that this website m...
<br />Yesterday I saw at W3C that the new HT...
The following attributes are not very compatible w...
How to host two or more sites on the popular and ...
Why is it that when the input tag type is file an...
Preface In fact, the humble "!" has man...
The main contents of this article are as follows:...
Table of contents Start by clicking the input box...
Table of contents Preface Rendering Example Code ...
1. Install JDK 1. Uninstall the old version or th...
1. System environment [root@localhost home]# cat ...
1. Change the virtual machine hardware version in...
Zabbix 2019/10/12 Chenxin refer to https://www.za...