- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What Linux utility for sorting processes by network usage?
Linux provides the famous top command utility that provides us with all the information about the processes, their time, their respective IDs, how much CPU chunk they are consuming and much more. The only issue with that is the processes are not sorted in any order and the order changes frequently.
There are certain cases where we would like the output to be in a sorted manner somehow, like sorted in the sense that the process which is using the most network will be at the top.
One such command line program that we can use that will provide us the desired output is NetHogs.
NetHogs is a command line program that is used to monitor real time network traffic bandwidth used by each process or application.
For CentOS and Fedora
yum install nethogs
For Ubuntu and Debian
sudo apt-get install nethogs
Now that we have nethogs installed we can make use of it by the commands shown below −
For red-hat based systems
To execute it, it is necessary to provide the root permissions, so we run it with the sudo command as shown below −
PID USER PROGRAM DEV SENT RECEIVED 4071 immukul /usr/lib/sample.go wlp1s0 0.032 0.019 KB/sec 89828 immukul /usr/lib/thunderbird wlp1s0 0.029 0.017 KB/sec 15972 immukul unknown TCP wlp1s0 0.018 0.011 KB/sec 78292 immukul --skype-process wlp1s0 0.008 0.003 KB/sec
- How to see top processes sorted by actual memory usage on Linux?
- Threads vs Processes in Linux
- Zombie and Orphan Processes in Linux
- How to Find the List of Daemon Processes and Zombie Processes in Linux
- What is Network Sniffing? Types, Working, Usage, Tools
- How to find and kill running processes in linux
- How to Kill Linux Processes Using ‘xkill’ Command
- Great tools to check linux disk partitions and usage in linux
- How to free Inode usage on Linux?
- How to limit network bandwidth on linux
- Installing MySQL Using Unbreakable Linux Network (ULN)
- How to find out which processes are using swap space in Linux?
- C Program for Pancake sorting?