In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you how to view the ports being used by the Linux system, which is easy to understand and clear. I hope it can help you solve your doubts. Let's take you to study and learn the article "how to check the ports in use by the Linux system".
Using netstat to check port netstat is a command line tool that provides information about network connections.
To list all TCP or UDP ports that are listening, including services that use port and socket status, use the following command: netstat-tunlp
The options used in this command have the following meanings:
-t-displays the TCP port. -u-displays the UDP port. -n-displays a numeric address instead of a hostname. -l-only the listening port is displayed. -p-displays the PID and name of the process. This information appears only if you run the command as root or sudo.
Query the specified port and filter through grep: netstat-tnlp | grep: 80
Show an example:
Note: Proto-the protocol used by the socket. Local Address-the IP address and port number on which the process listens. PID/Program name-PID and process name.
Second, use ss to check that the port ss is the new netstat, and the command options are roughly the same. It lacks some netstat functionality, but exposes more TCP status, and is slightly faster.
Use example: ss-tunlp
Using lsof to check Port lsof is a powerful command-line utility that provides information about files opened by the process.
In Linux, everything is a file, and sockets can be thought of as files written to the network.
To use lsof to get a list of all listening TCP ports: lsof-nP-iTCP-sTCP:LISTEN
The options used are as follows:-n-do not convert the port number to the port name. -p-do not resolve the hostname, display the numeric address. -iTCP-sTCP:LISTEN-displays only network files with the TCP protocol status of LISTEN.
Examples of use:
To find a process that is listening on a specific port, such as 3306, use the following command: sudo lsof-nP-iTCP:3306-sTCP:LISTEN
What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.
The above is about "how the Linux system looks at the ports in use". If this article is helpful and well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.
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.