How to check whether the port is open under centos

王林
Release: 2020-04-01 15:07:29
Original
6950 people have browsed it

How to check whether the port is open under centos

You can use netstat or lsof to view it under CentOS, as follows:

1, netstat

netstat -nap #会列出所有正在使用的端口及关联的进程/应用
Copy after login

2, lsof

lsof -i :portnumber #portnumber要用具体的端口号代替,可以直接列出该端口听使用进程/应用
Copy after login

For example, to check the occupancy of port 80, use the following command:

lsof -i tcp:80
Copy after login

Recommended related tutorials: centos tutorial

The above is the detailed content of How to check whether the port is open under centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template