<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>loopkid: finding large directories</title>
    <link>http://loopkid.net/articles/2007/10/30/finding-large-directories</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>sad songs make me happy</description>
    <item>
      <title>finding large directories</title>
      <description>&lt;p&gt;Every once in a while there is the need to clear out the system. The question that inevitably pops up is: Where has all the disk space gone ? The solution of course lies in locating the largest directories. With &lt;a href="http://www.id-design.com/software/whatsize/"&gt;WhatSize&lt;/a&gt; and &lt;a href="http://www.omnigroup.com/applications/omnidisksweeper/"&gt;OmniDiskSweeper&lt;/a&gt; there are two great tools on Mac OS X. There are also feasible Tools on Linux like &lt;a href="http://www.methylblue.com/filelight/"&gt;Filelight&lt;/a&gt;, but if you&amp;#8217;re administering a remote server and you don&amp;#8217;t want to use remote x11 access you need a solution that can be controlled either on the command line or via browser. Of course you could use sturdy old du.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
# Find all directories with the largest directories on top
$ sudo du -Sx / | sort -nr | less
# Find directories over 100MB with the largest directories on top
$ sudo du -Sh / | grep ^[1-9][0-9][0-9][0-9\.]*M | sort -nr
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or you could hack together some fancy &lt;a href="http://www.macosxhints.com/article.php?story=20070912091217207"&gt;perl&lt;/a&gt; &lt;a href="http://www.itworld.com/Comp/3380/nls_unixscrounge102104/index.html"&gt;script&lt;/a&gt;, but wouldn&amp;#8217;t it be nice to have an interactive graphical visualisation through which you could comfortably navigate ? This is where &lt;a href="http://zevv.nl/code/philesight/"&gt;Philesight&lt;/a&gt; pops in, which offers both command line and browserbased control. Putting it up on Debian is a breeze. Just install cairo and berkley db and their ruby bindings and then get rolling.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
$ wget http://zevv.nl/code/philesight/philesight-2035.tgz
$ tar xvfz philesight-2035.tgz
$ sudo apt-get install libcairo2 libcairo-ruby
$ sudo apt-get install libdb4.2 libdb4.2-ruby1.8
# Generate index
$ sudo ./philesight --db base.db --index /
# Check if image is correctly generated
$ ./philesight --db base.db --path / --draw base.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Firing up the web interface is just three small steps further. First configure the CGI-File.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
# philelight.cgi
db = "./base.db"
default_path = "/"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then create a reasonably named subdomain and after that just add a few lines to your lighttpd configuration file (or the corresponding lines to the webserver of your choice).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
$HTTP["host"] =~ "philesight.yourdomain.net" {
  cgi.assign = ( ".cgi" =&gt; "/usr/bin/ruby" )
  alias.url = ( "/" =&gt; "/path/to/philesight/philesight.cgi")
  server.document-root = "/path/to/philesight"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That&amp;#8217;s all there&amp;#8217;s to it. Have fun.&lt;/p&gt;</description>
      <pubDate>Tue, 30 Oct 2007 23:49:25 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:90409df3-5f23-456d-a411-726536c84683</guid>
      <author>Stefan</author>
      <link>http://loopkid.net/articles/2007/10/30/finding-large-directories</link>
      <category>English</category>
      <category>Software</category>
      <category>Mac OS X</category>
      <category>Linux</category>
    </item>
    <item>
      <title>"finding large directories" by bjoern</title>
      <description>&lt;p&gt;Ich verwende immernoch disk usage. Filelight ist mir zu instabil.&lt;/p&gt;</description>
      <pubDate>Sun, 04 Nov 2007 14:51:17 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:c84b1ae2-adba-4e52-9a89-e5d5e35d6227</guid>
      <link>http://loopkid.net/articles/2007/10/30/finding-large-directories#comment-4070</link>
    </item>
  </channel>
</rss>
