How to check port status in Linux

小云云
Release: 2018-03-29 17:24:42
Original
4273 people have browsed it
  1. In the process of using Linux, you need to know which ports are currently open in the system, and to check the specific processes and users that open these ports, you can use the netstat command to make a simple query. This article mainly shares Linux with you. How to check the port status, I hope it can help everyone.

  2. The parameters of the netstat command are described as follows:

  3. -t: Specify the TCP port to be displayed

    -u: Specify the UDP port to be displayed Port

     -l: Display only the listening socket (the so-called socket is a program that enables the application to read, write, and send and receive communication protocols and data)

     -p: Display Process identifier and program name, each socket/port belongs to a program.

     -n: Do not perform DNS polling, display IP (can speed up the operation)

  4. can display all ports and process services on the current server, and can be combined with grep Check a specific port and service status··

  5. netstat -ntlp   //查看当前所有tcp端口·
    netstat -ntulp |grep 80   //查看所有80端口使用情况·
    netstat -an | grep 3306   //查看所有3306端口使用情况·
    Copy after login
  6. For example, to check whether the current Mysql default port 3306 is started, you can do the following.

  7. Related recommendations:

  8. Three ways to close the Linux system port

The above is the detailed content of How to check port status in Linux. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!