<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Du on Amit Agarwal Linux Blog</title>
    <link>/tags/du/</link>
    <description>Recent content in Du on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 12 Mar 2018 01:00:42 +0000</lastBuildDate>
    
	<atom:link href="/tags/du/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Highest disk usage of directory in subdirectories</title>
      <link>/2018/03/12/highest-disk-usage-directory-subdirectories/</link>
      <pubDate>Mon, 12 Mar 2018 01:00:42 +0000</pubDate>
      
      <guid>/2018/03/12/highest-disk-usage-directory-subdirectories/</guid>
      <description>&lt;p&gt;I find myself doing this lot of times so thought will share this with you all. Basically, once I want to clear out the directory, I first want to find out the sub-directory using the maximum disk space so I wrote a function for that and here it is:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;disk_usage_dirs () 
{ 
    find . -maxdepth 1 -type d -not -name &#39;.&#39; | while read line; do
        du -s &#34;$line&#34;;
    done | sort -n | tail -${1:-5}
}
&lt;/pre&gt;
&lt;p&gt;Some other posts you might find useful on this :&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
