{"id":3134,"date":"2021-03-19T13:59:13","date_gmt":"2021-03-19T18:59:13","guid":{"rendered":"https:\/\/microsoftgeek.com\/?p=3134"},"modified":"2021-03-19T14:01:02","modified_gmt":"2021-03-19T19:01:02","slug":"duf-a-better-linux-disk-monitoring-utility","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=3134","title":{"rendered":"Duf \u2013 A Better Linux Disk Monitoring Utility"},"content":{"rendered":"\n<p><strong>duf<\/strong>\u00a0is one of the fancy\u00a0Linux disk monitoring utilities\u00a0written in Golang. It is released under MIT license and It supports Linux, macOS, BSD, and even Windows too. Some of the core features of duf include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>a better \u2018df command\u2018 alternative.<\/li><li>Light and Dark color scheme.<\/li><li>Output in JSON format.<\/li><li>Option to sort, group, and filter output.<\/li><li>Adjustable terminal Height and Width.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Duf (Disk Usage) Tool in Linux<\/h3>\n\n\n\n<p>There are two ways you can install&nbsp;<strong>DUF<\/strong>. You can either build it from the source or download the setup in native format (<strong>.rpm<\/strong>&nbsp;or&nbsp;<strong>.deb<\/strong>) specific to Linux distribution and install it. I will walk you through both methods.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Building Duf from Source<\/h4>\n\n\n\n<p>You need to\u00a0set up the Go (1.12 or above)\u00a0environment to compile\u00a0<strong>duf<\/strong>. If you don\u2019t have Go set up in your machine, take a look at our comprehensive article on how to\u00a0set up Go in Ubuntu.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ git clone https:\/\/github.com\/muesli\/duf.git\n$ cd duf\n$ go build\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Installing Duf from Packages<\/h4>\n\n\n\n<p>You can download the duf package from the\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/muesli\/duf\/releases\" target=\"_blank\">Github repo directly<\/a>\u00a0or use the\u00a0wget command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">--------- <strong>On Debina, Ubuntu &amp; Mint<\/strong> --------- \n$ wget https:\/\/github.com\/muesli\/duf\/releases\/download\/v0.6.0\/duf_0.6.0_linux_amd64.deb\n$ dpkg -i duf_0.6.0_linux_amd64.deb \n\n\n--------- <strong>On RHEL, CentOS &amp; Fedora<\/strong> ---------\n$ wget https:\/\/github.com\/muesli\/duf\/releases\/download\/v0.6.0\/duf_0.6.0_linux_amd64.rpm\n$ rpm -ivh duf_0.6.0_linux_amd64.rpm\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Usage of Duf (Disk Usage) Tool in Linux<\/h3>\n\n\n\n<p>Now, launch the application by simply typing&nbsp;<strong>duf<\/strong>&nbsp;from the terminal.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41751\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Linux-Disk-Usage.png\" alt=\"Linux Disk Usage\" class=\"wp-image-41751\"\/><figcaption>Linux Disk Usage<\/figcaption><\/figure>\n\n\n\n<p><strong>Duf<\/strong>&nbsp;has a lot of features, so a good place to start would be to use&nbsp;<code>--help<\/code>&nbsp;option.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf --help\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41752\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Duf-Help.png\" alt=\"Duf Help\" class=\"wp-image-41752\"\/><figcaption>Duf Help<\/figcaption><\/figure>\n\n\n\n<p>You can print only specific file systems or devices by passing it as an argument. Since I created this machine in a single partition everything is mounted on the&nbsp;<strong>root (\/)<\/strong>. Based upon your partition scheme you will see different output.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf \/home \/usr \/opt\n$ duf \/root\/\n$ duf \/var\/log\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41753\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Check-Disk-Usage-of-Partitions.png\" alt=\"Check Disk Usage of Partitions\" class=\"wp-image-41753\"\/><figcaption>Check Disk Usage of Partitions<\/figcaption><\/figure>\n\n\n\n<p>You can pass&nbsp;<code>--all<\/code>&nbsp;flag to display Pseudo, inaccessible, and duplicate file systems.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf -all\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41754\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Duf-Options.png\" alt=\"Duf Options\" class=\"wp-image-41754\"\/><figcaption>Duf Options<\/figcaption><\/figure>\n\n\n\n<p>Instead of printing block usage, we can print Inode usage bypassing&nbsp;<code>--inodes<\/code>&nbsp;as an argument.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf --inodes\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41755\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Check-Linux-Inode-Usage.png\" alt=\"Check Linux Inode Usage\" class=\"wp-image-41755\"\/><figcaption>Check Linux Inode Usage<\/figcaption><\/figure>\n\n\n\n<p>You can sort output or display only certain columns based on certain keywords.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf --sort size\n<\/pre>\n\n\n\n<p>You have the option to print only certain columns bypassing the column name as an argument to&nbsp;<code>--output<\/code>&nbsp;flag.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf --output used,size,avail,usage\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41756\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Linux-Disk-Usage-Summary.png\" alt=\"Linux Disk Usage Summary\" class=\"wp-image-41756\"\/><figcaption>Linux Disk Usage Summary<\/figcaption><\/figure>\n\n\n\n<p>Below are the list of valid keywords.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>mountpoint<\/li><li>size<\/li><li>used<\/li><li>avail<\/li><li>usage<\/li><li>inodes<\/li><li>inodes_used<\/li><li>inodes_avail<\/li><li>inodes_usage<\/li><li>type<\/li><li>filesystem<\/li><\/ul>\n\n\n\n<p>Duf comes with a light and dark color scheme. To set the color scheme, use the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf -theme dark               # Dark color scheme\n$ duf --theme light             # Light color scheme\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41757\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Check-Duf-Color-Scheme.png\" alt=\"Check Duf Color Scheme\" class=\"wp-image-41757\"\/><figcaption>Check Duf Color Scheme<\/figcaption><\/figure>\n\n\n\n<p>Duf supports output in JSON format.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ duf --json\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_41758\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2021\/02\/Duf-JSON-Format.png\" alt=\"Duf JSON Format\" class=\"wp-image-41758\"\/><figcaption>Duf JSON Format<\/figcaption><\/figure>\n\n\n\n<p>That\u2019s it for this article.&nbsp;<strong>Duf<\/strong>&nbsp;is a maturing tool and there are more features and bug fixes added to it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>duf\u00a0is one of the fancy\u00a0Linux disk monitoring utilities\u00a0written in Golang. It is released under MIT license and It supports Linux, macOS, BSD, and even Windows too. Some of the core features of duf include: a better \u2018df command\u2018 alternative. Light and Dark color scheme. Output in JSON format. Option to sort, group, and filter output. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-3134","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3134"}],"version-history":[{"count":2,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3134\/revisions"}],"predecessor-version":[{"id":3136,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3134\/revisions\/3136"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}