Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use watch to observe TCP and UDP ports in real time

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use watch to observe TCP and UDP ports in real time. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

In terms of software, especially at the operating system level, a port is a logical structure that identifies a particular process / application or type of network service, and each network service running on a Linux system uses a specific protocol (most commonly TCP (Transmission Control Protocol) and UDP (user Datagram Protocol) and the port number used to communicate with other processes or services.

In this short article, we will show you how to use the socket feed on Linux systems to list and monitor or monitor running TCP and UDP ports in real time.

List all open ports in Linux

To list all open ports on a Linux system, you can use the netstat command or the ss utility, as shown below.

It is also important to mention that the netstat command has been deprecated, while the ss command has replaced the display of more detailed network statistics.

Sudo netstat-tulpn

Or

Sudo ss-tulpn

From the output of the above command, the "State" column shows whether the port is in the listening state (LISTEN).

In the above command, the flag:

-t-enables the list of TCP ports.

-u-enables the list of UDP ports.

-l-only print listening sockets.

-n-displays the port number.

-p-displays the process / program name.

Real-time observation of TCP and UDP open ports

"however, to monitor TCP and UDP ports in real time, you can run the netstat or ss tool using the watch utility shown."

Sudo watch netstat-tulpn

Or:

Sudo watch ss-tulpn

To exit, press Ctrl + C.

OK, that's it so far! If you have any questions or thoughts about this article, please contact us through the comments section below.

On how to use watch real-time observation of TCP and UDP ports to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report