In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how linux checks whether the port is open or not. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
In linux, we can check whether the port is open by using the lsof command and the netstat command on the command line.
Method 1: use the lsof command
We can use the lsof command to check whether a port is open. The basic syntax is as follows:
Lsof-I: Port number
If there is no output, the port number is not open.
The following figure takes ports 80 and 53 as examples to check whether ports 80 and 53 are open
You can also use the lsof-I command to output open ports directly to see if some ports are open.
Method 2: use the netstat command
The netstat command provides network-related information about the host.
We can use netstat-atu to check open ports in linux
The netstat logo we use: introduction to-amam talk t and-u
-a: all sockets.
-t: TCP connection to the program
-u: UDP connection to the program
You can also add the-p flag to display the relevant PID of the process or program name.
To display only UDP ports, you can use the following command:
To display only TCP ports, you can use the following command:
Thank you for reading! This is the end of linux's method of checking whether the port is open. I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.
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.