{"id":10462,"date":"2021-09-28T10:04:40","date_gmt":"2021-09-28T10:04:40","guid":{"rendered":"https:\/\/linuxways.net\/?p=10462"},"modified":"2021-09-28T10:04:40","modified_gmt":"2021-09-28T10:04:40","slug":"iftop-command-in-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/iftop-command-in-linux\/","title":{"rendered":"iftop Command in Linux"},"content":{"rendered":"<p>Iftop stands for Interface Top<strong>. <\/strong>It is a network monitoring tool that monitors and results in total bandwidth usage. It is useful for all system admin to monitor the network and bandwidth usage.<\/p>\n<p>In this article, we are going to install the iftop on Ubuntu 20.04 and show it\u2019s use cases with examples. You can install it on any other Linux-based system.<\/p>\n<h3>Install on Ubuntu 20.04<\/h3>\n<p>Install iftop with the following command for Ubuntu\/Debian based:<\/p>\n<pre>$ sudo apt install -y iftop<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"186\" class=\"wp-image-10463\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-509.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-509.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-509-300x77.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<h3>Use cases of Iftop command:<\/h3>\n<p>After installing iftop, you can use it to check network bandwidth usage with the following commands. Basic syntax of iftop command is :<\/p>\n<pre>$ sudo iftop [option]<\/pre>\n<h4>To check the total bandwidth usage<\/h4>\n<p>Check the total bandwidth of the default interface by simply using the command as shown below:<\/p>\n<pre>$ sudo iftop<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"582\" height=\"70\" class=\"wp-image-10464\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-510.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-510.png 582w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-510-300x36.png 300w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"476\" class=\"wp-image-10465\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-511.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-511.png 723w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-511-300x198.png 300w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/p>\n<h4>To check the bandwidth usage of the specific interface<\/h4>\n<p>Check the bandwidth usage of the specific network interface with the following command:<\/p>\n<pre>$ sudo iftop -i [interface]<\/pre>\n<p>Here, we are checking for the specific wan interface:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"609\" height=\"74\" class=\"wp-image-10466\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-512.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-512.png 609w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-512-300x36.png 300w\" sizes=\"auto, (max-width: 609px) 100vw, 609px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"477\" class=\"wp-image-10467\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-513.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-513.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-513-300x197.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<h4>To display the output in instinctive format<\/h4>\n<p>Display the output on clear and instinctive format, you can use the following command:<\/p>\n<pre>$ sudo iftop -t<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"581\" height=\"70\" class=\"wp-image-10468\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-514.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-514.png 581w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-514-300x36.png 300w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"833\" height=\"637\" class=\"wp-image-10469\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-515.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-515.png 833w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-515-300x229.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-515-768x587.png 768w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/p>\n<h4>To display the output of the bandwidth usage on Bytes<\/h4>\n<p>Display the total bandwidth usage of the specific interface or overall bandwidth status on Bytes with the following command:<\/p>\n<pre>$ sudo iftop -i enp1s0 -B<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"580\" height=\"81\" class=\"wp-image-10470\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-516.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-516.png 580w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-516-300x42.png 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"698\" height=\"460\" class=\"wp-image-10471\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-517.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-517.png 698w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-517-300x198.png 300w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/p>\n<h4>To display the output avoiding the hostname lookup<\/h4>\n<p>Display the bandwidth usage status without the hostname lookup using the following command:<\/p>\n<pre>$ sudo iftop -n -i enp1s0<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"76\" class=\"wp-image-10472\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-518.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-518.png 579w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-518-300x39.png 300w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"696\" height=\"459\" class=\"wp-image-10473\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-519.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-519.png 696w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-519-300x198.png 300w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/p>\n<h4>To display the output sorting by source address<\/h4>\n<p>Display the output sorting as per source address with the following command:<\/p>\n<pre>$ sudo iftop -o source<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"70\" class=\"wp-image-10474\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-520.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-520.png 590w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-520-300x36.png 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"460\" class=\"wp-image-10475\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-521.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-521.png 705w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-521-300x196.png 300w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/p>\n<h4>To display the output sorting by destination address<\/h4>\n<p>Display the output sorting as per destination address with the following command:<\/p>\n<pre>$ sudo iftop -o destination<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"69\" class=\"wp-image-10476\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-522.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-522.png 590w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-522-300x35.png 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"462\" class=\"wp-image-10477\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-523.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-523.png 706w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-523-300x196.png 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/p>\n<h4>To display the output without bar graph<\/h4>\n<p>Display the output by removing the bar graph with the below command:<\/p>\n<pre>$ sudo iftop -b<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"69\" class=\"wp-image-10478\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-524.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-524.png 590w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-524-300x35.png 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"460\" class=\"wp-image-10479\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-525.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-525.png 706w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-525-300x195.png 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/p>\n<h4>To display the output with port numbers and hostnames<\/h4>\n<p>Display the output with the port numbers and hostnames by using the below command:<\/p>\n<pre>$ sudo iftop -P<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"72\" class=\"wp-image-10480\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-526.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-526.png 589w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-526-300x37.png 300w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"458\" class=\"wp-image-10481\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-527.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-527.png 707w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-527-300x194.png 300w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/p>\n<h4>To display and print the specific number of lines<\/h4>\n<p>Display the output by providing the specific number so only such a number of lines can be printed out as output. Use the following command to print 4 lines as output for a specific interface.<\/p>\n<pre>$ sudo iftop -i enp1s0 -L 4<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"587\" height=\"70\" class=\"wp-image-10482\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-528.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-528.png 587w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-528-300x36.png 300w\" sizes=\"auto, (max-width: 587px) 100vw, 587px\" \/><\/p>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"460\" class=\"wp-image-10483\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-529.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-529.png 706w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-529-300x195.png 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/p>\n<h3>Conclusion<\/h3>\n<p>With the iftop command, it will be very useful for all Linux users to monitor the overall or specific interface bandwidth usage. Try using the above commands and enhance the power as a Linux User. Thank you!<\/p>","protected":false},"excerpt":{"rendered":"<p>Iftop stands for Interface Top. It is a network monitoring tool that monitors and results in total bandwidth usage. It is useful for all system admin to monitor&hellip;<\/p>","protected":false},"author":1,"featured_media":10624,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4,5,83,165,2],"tags":[563,35],"class_list":["post-10462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-debian","category-mint","category-opensuse","category-red-hat","category-ubuntu","tag-iftop-command","tag-linux"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=10462"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10462\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/10624"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=10462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=10462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=10462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}