{"id":11454,"date":"2019-03-14T08:02:27","date_gmt":"2019-03-14T08:02:27","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11454"},"modified":"2019-03-14T08:02:27","modified_gmt":"2019-03-14T08:02:27","slug":"dutree-a-cli-tool-to-analyze-disk-usage-in-coloured-output","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/14\/dutree-a-cli-tool-to-analyze-disk-usage-in-coloured-output\/","title":{"rendered":"dutree \u2013 A CLI Tool to Analyze Disk Usage in Coloured Output"},"content":{"rendered":"<p><strong>dutree<\/strong>\u00a0is a free open-source, fast command-line tool for\u00a0<a href=\"https:\/\/www.tecmint.com\/check-linux-disk-usage-of-files-and-directories\/\" target=\"_blank\" rel=\"noopener\">analyzing disk usage<\/a>, written in\u00a0<a href=\"https:\/\/www.tecmint.com\/install-rust-programming-language-in-linux\/\" target=\"_blank\" rel=\"noopener\">Rust programming language<\/a>. It is developed from\u00a0<strong>durep<\/strong>\u00a0(<strong>disk usage reporter<\/strong>) and\u00a0<strong>tree<\/strong>\u00a0(list directory content in tree-like format) command line tools.\u00a0<strong>dutree<\/strong>\u00a0therefore reports disk usage in a tree-like format.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/agedu-track-disk-space-usage-in-linux\/\" target=\"_blank\" rel=\"noopener\">Agedu \u2013 A Useful Tool for Tracking Down Wasted Disk Space in Linux<\/a><\/p>\n<p>It displays coloured output, depending on values configured in the\u00a0<strong>GNU LS_COLORS<\/strong>\u00a0environment variable. This\u00a0<strong>env variable<\/strong>\u00a0enables for setting the colours of files based on extension, permissions as well as file type.<\/p>\n<h4>dutree Features:<\/h4>\n<ul>\n<li>Show the file system tree.<\/li>\n<li>Supports aggregating of small files.<\/li>\n<li>Allows for comparing different directories.<\/li>\n<li>Supports excluding of files or directories.<\/li>\n<\/ul>\n<h3>How to Install dutree in Linux Systems<\/h3>\n<p>To install\u00a0<strong>dutree<\/strong>\u00a0in Linux distributions, you must have rust programming language installed on your system as shown.<\/p>\n<pre>$ sudo curl https:\/\/sh.rustup.rs -sSf | sh\r\n<\/pre>\n<p><center>Once\u00a0<strong>rust<\/strong>\u00a0installed, you can run the following command to install strong&gt;dutree in Linux distributions as shown.<\/center><\/p>\n<pre>$ cargo install --git https:\/\/github.com\/nachoparker\/dutree.git\r\n<\/pre>\n<p>After installing\u00a0<strong>dutree<\/strong>, it uses environment colors according to the variable\u00a0<strong>LS_COLORS<\/strong>, it has the same colors\u00a0<code>ls --color<\/code>\u00a0command that our distro has configured.<\/p>\n<pre>$ ls --color\r\n<\/pre>\n<p>The simplest way of running\u00a0<strong>dutree<\/strong>\u00a0is without arguments, this way it shows a filesystem tree.<\/p>\n<pre>$ dutree\r\n<\/pre>\n<div id=\"attachment_29080\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Filesystem-Disk-Usage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29080\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Filesystem-Disk-Usage.png\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Filesystem-Disk-Usage.png 792w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Filesystem-Disk-Usage-768x444.png 768w\" alt=\"Linux Filesystem Disk Usage\" width=\"792\" height=\"458\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Linux Filesystem Disk Usage<\/p>\n<\/div>\n<p>To display real disk usage instead of file size, use the\u00a0<code>-u<\/code>\u00a0flag.<\/p>\n<pre>$ dutree -u \r\n<\/pre>\n<div id=\"attachment_29081\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Linux-Disk-Usage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29081\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Linux-Disk-Usage.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Linux-Disk-Usage.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Linux-Disk-Usage-768x311.png 768w\" alt=\"Show Linux Disk Usage\" width=\"802\" height=\"325\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Show Linux Disk Usage<\/p>\n<\/div>\n<h4>Show Directories in Depth<\/h4>\n<p>You can show directories up to a given\u00a0<strong>depth<\/strong>\u00a0(default\u00a0<strong>1<\/strong>), using the\u00a0<code>-d<\/code>\u00a0flag. The command below will show directories up to a\u00a0<strong>depth<\/strong>\u00a0of\u00a0<strong>3<\/strong>, under the current working directory.<\/p>\n<p>For example if the current working directory\u00a0<code>(~\/)<\/code>, then display size of\u00a0<code>~\/*\/*\/*<\/code>\u00a0as shown in the following sample screenshot.<\/p>\n<pre>$ dutree -d 3\r\n<\/pre>\n<div id=\"attachment_29082\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Directories-in-Depth-Disk-Usage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29082\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Directories-in-Depth-Disk-Usage.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Directories-in-Depth-Disk-Usage.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Show-Directories-in-Depth-Disk-Usage-768x475.png 768w\" alt=\"Show Directories in Depth Disk Usage\" width=\"802\" height=\"496\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Show Directories in Depth Disk Usage<\/p>\n<\/div>\n<h4>Exclude Files or Directories in Output<\/h4>\n<p>To exclude matching a file or directory name, use the\u00a0<code>-x<\/code>\u00a0flag.<\/p>\n<pre>$ dutree -x CentOS-7.0-1406-x86_64-DVD.iso \r\n<\/pre>\n<div id=\"attachment_29083\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Exclude-Filename-in-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29083\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Exclude-Filename-in-output.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Exclude-Filename-in-output.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Exclude-Filename-in-output-768x329.png 768w\" alt=\"Show Disk Usage with Exclude Filename\" width=\"802\" height=\"344\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Show Disk Usage with Exclude Filename<\/p>\n<\/div>\n<p>You can also get a quick local overview by skipping directories, using the\u00a0<code>-f<\/code>\u00a0option, like so.<\/p>\n<pre>$ dutree -f\r\n<\/pre>\n<div id=\"attachment_29085\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Quick-Overview-by-Skipping-Directories.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29085\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Quick-Overview-by-Skipping-Directories.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Quick-Overview-by-Skipping-Directories.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Quick-Overview-by-Skipping-Directories-768x530.png 768w\" alt=\"Quick Overview by Skipping Directories\" width=\"802\" height=\"553\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Quick Overview by Skipping Directories<\/p>\n<\/div>\n<p>A full summary\/overview can be generated using the\u00a0<code>-s<\/code>\u00a0flag as shown.<\/p>\n<pre>$ dutree -s\r\n<\/pre>\n<div id=\"attachment_29086\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Disk-Usage-Summary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29086\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Disk-Usage-Summary.png\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Disk-Usage-Summary.png 792w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Linux-Disk-Usage-Summary-768x352.png 768w\" alt=\"Linux Disk Usage Summary\" width=\"792\" height=\"363\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Linux Disk Usage Summary<\/p>\n<\/div>\n<h4>Aggregate Small Files<\/h4>\n<p>It is possible to aggregate files smaller than a certain size, default is\u00a0<strong>1M<\/strong>\u00a0as shown.<\/p>\n<pre>$ dutree -a \r\n<\/pre>\n<div id=\"attachment_29087\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Aggregate-Small-Files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29087\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Aggregate-Small-Files.png\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Aggregate-Small-Files.png 972w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Aggregate-Small-Files-768x362.png 768w\" alt=\"Aggregate Small Files\" width=\"972\" height=\"458\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Aggregate Small Files<\/p>\n<\/div>\n<h4>Exclude Hidden Files<\/h4>\n<p>The\u00a0<code>-H<\/code>\u00a0switch allows for excluding hidden files in the output.<\/p>\n<pre>$ dutree -H\r\n<\/pre>\n<p>The\u00a0<code>-b<\/code>\u00a0option is used to print sizes in bytes, instead of kilobytes (default).<\/p>\n<pre>$ dutree -b\r\n<\/pre>\n<p>To turn off colors, and only display\u00a0<strong>ASCII<\/strong>\u00a0characters, use the\u00a0<code>-A<\/code>\u00a0flag like so.<\/p>\n<pre>$ dutree -A\r\n<\/pre>\n<p>You can view the dutree help message using the\u00a0<code>-h<\/code>\u00a0option.<\/p>\n<pre><strong>$ dutree -h<\/strong>\r\n\r\nUsage: dutree [options]  [..]\r\n \r\nOptions:\r\n    -d, --depth [DEPTH] show directories up to depth N (def 1)\r\n    -a, --aggr [N[KMG]] aggregate smaller than N B\/KiB\/MiB\/GiB (def 1M)\r\n    -s, --summary       equivalent to -da, or -d1 -a1M\r\n    -u, --usage         report real disk usage instead of file size\r\n    -b, --bytes         print sizes in bytes\r\n    -x, --exclude NAME  exclude matching files or directories\r\n    -H, --no-hidden     exclude hidden files\r\n    -A, --ascii         ASCII characters only, no colors\r\n    -h, --help          show help\r\n    -v, --version       print version number\r\n<\/pre>\n<p><strong>dutree Github Repository<\/strong>:\u00a0<a href=\"https:\/\/github.com\/nachoparker\/dutree\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/nachoparker\/dutree<\/a><\/p>\n<p><strong>dutree<\/strong>\u00a0is a simple yet powerful command-line tool to show file size and analyze disk usage in tree-like format, on Linux systems. Use the comment form below to share your thoughts or queries about it, with us.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/dutree-analyze-disk-usage-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>dutree\u00a0is a free open-source, fast command-line tool for\u00a0analyzing disk usage, written in\u00a0Rust programming language. It is developed from\u00a0durep\u00a0(disk usage reporter) and\u00a0tree\u00a0(list directory content in tree-like format) command line tools.\u00a0dutree\u00a0therefore reports disk usage in a tree-like format. Read Also:\u00a0Agedu \u2013 A Useful Tool for Tracking Down Wasted Disk Space in Linux It displays coloured output, depending &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/14\/dutree-a-cli-tool-to-analyze-disk-usage-in-coloured-output\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;dutree \u2013 A CLI Tool to Analyze Disk Usage in Coloured Output&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11454","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11454"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11454\/revisions"}],"predecessor-version":[{"id":11455,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11454\/revisions\/11455"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}