Get the App
SLTechnology News&Howtos  ›  Development  › 

How to view network traffic and bandwidth in Linux

Shulou Source: shulou.com Published: 2022-06-01 20:23:41 10月03日 Update

Editor to share with you how to check network traffic and bandwidth in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Iftop is similar to top's real-time traffic monitoring tool, which can be used to monitor the real-time traffic of the network card (you can specify a network segment), reverse parse IP, display port information, and so on.

See which ports the traffic is sent from:

# iftop-P

The-P option turns on the port display in the output of iftop.

The interface shows a scale range similar to that of a scale, which is used as a ruler for long bars that display flow patterns.

The two left and right arrows in the middle indicate the direction of the traffic.

TX: sending traffic

RX: receive traffic

TOTAL: total traffic

Cumm: total traffic from running iftop to the current time

Peak: peak traffic

Rates: indicates the average traffic in the past 2s, 10s, 40s respectively

To find the process running on that port, you can use netstat or lsof to find the appropriate process.

Use the netstat command to find the process running on port 10910:

# netstat-tunp | grep 10910

You can use the lsof command to find the process running on port 10909:

# lsof-iPlus 10909

View an application with a process PID of 51919:

# ps-ef | grep 51919

The above is all the contents of the article "how to View Network Traffic and bandwidth in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Traffic port process run article bandwidth network content scale command real-time total traffic monitoring not much two information scale graphics most peak Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Technology Shulou Information vpn Apple