- Jan 9, 2023
- 264
- 43
I've recently been experimenting with network monitoring on Linux. Have you guys ever wondered which processes are most actively using network connections on your computer? That was my thought, so I began searching for answers.
- nethogs
- First, I tried nethogs. It's truly a magical tool. It provided me with a real-time snapshot of which processes were accessing the network, much like how we often use the htop or top tools to monitor CPU and memory. Installation was straightforward; I used the sudo apt install nethogs command on Ubuntu.
- lsof
- Next up was lsof. While it's primarily used to list open files, I found it could also list open network connections. Using the -i option, I could see network connections associated with processes running on my system. Quite handy!
- netstat
- netstat is another great tool that allows me to view network connections on the system. While it doesn't inherently show which processes are associated with the network connections, combined with other command-line options, I could get the information I was after.