Home  >  Article  >  Operation and Maintenance  >  How to check if a port is open in Linux

How to check if a port is open in Linux

王林
王林Original
2019-12-26 15:24:324922browse

How to check if a port is open in Linux

First we open the Linux command operation interface to view the port, as shown in the figure:

How to check if a port is open in Linux

In order to get more information High authority (view all ports), switch to root user login here

How to check if a port is open in Linux

Free video tutorial sharing:linux video tutorial

One way is to use the lsof command, taking 80 as an example, as shown in the figure:

How to check if a port is open in Linux

If there is no output, it means that the function is not enabled. The port number.

In order to facilitate testing, I detect an open port number here, and the information as shown in the figure will be output:

How to check if a port is open in Linux

The second method is to use netstat -aptn command line, view all open port numbers

How to check if a port is open in Linux

The command shown in the picture is to view all port numbers using the udp protocol in the system

How to check if a port is open in Linux

This command is to view the port number information using the tcp protocol in the system

How to check if a port is open in Linux

Related video tutorial sharing: linux tutorial

The above is the detailed content of How to check if a port is open in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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