<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Linux &#8211; disk usage (du) human readable AND sorted by size</title>
	<atom:link href="http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/</link>
	<description>Down to Earth Information</description>
	<lastBuildDate>Wed, 10 Mar 2010 20:28:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gordon Mohr</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-58</link>
		<dc:creator>Gordon Mohr</dc:creator>
		<pubDate>Tue, 19 May 2009 21:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-58</guid>
		<description>I like &#039;-h&#039; too; it doesn&#039;t have to go away for &#039;hu&#039; to also exist and be useful in other contexts, or when people need a sort to precision hidden by &#039;-h&#039; rounding.</description>
		<content:encoded><![CDATA[<p>I like &#8216;-h&#8217; too; it doesn&#8217;t have to go away for &#8216;hu&#8217; to also exist and be useful in other contexts, or when people need a sort to precision hidden by &#8216;-h&#8217; rounding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Sares</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-56</link>
		<dc:creator>Jason Sares</dc:creator>
		<pubDate>Tue, 19 May 2009 05:54:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-56</guid>
		<description>my solution

du -s * 2&gt;/dev/null &#124; sort -n &#124; cut -f2 &#124; xargs du -sh 2&gt;/dev/null</description>
		<content:encoded><![CDATA[<p>my solution</p>
<p>du -s * 2&gt;/dev/null | sort -n | cut -f2 | xargs du -sh 2&gt;/dev/null</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-53</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Mon, 18 May 2009 17:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-53</guid>
		<description>You can also set the BLOCK_SIZE environment variable to the value human-readable and all the GNU coreutils that report sizes will respect it.</description>
		<content:encoded><![CDATA[<p>You can also set the BLOCK_SIZE environment variable to the value human-readable and all the GNU coreutils that report sizes will respect it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Speer</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-52</link>
		<dc:creator>Michael Speer</dc:creator>
		<pubDate>Mon, 18 May 2009 14:37:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-52</guid>
		<description>Sat Jan 20 06:00:09 1996  Jim Meyering  (------@na-net.ornl.gov)

	---snip---

	* du.c (main): New options --human-readable (-h) and --megabytes (-m).
	(human_readable): New function.
        From Larry McVoy (------@sgi.com).

Ever since this patch was included in fileutils, system administrators have been frustrated by finding that while they could `du -h` they could not then `sort -h` the output.  -h is not posix but is now solidly a part of the gnu coreutils du and ls commands.  Including a switch for sort that respects the switch for du was not my invention.  It has been argued a number of times on the developers mailing list.  Mine was simply the straw which broke the camels back.  The additional switch is consistent with the other tools, and merely augments the purpose of sort without creating a differing utility to it.

Something of the functionality of `hu` may have been the appropriate fix in &#039;96, but since the &#039;96 -h switch is long set, adding a corresponding switch to sort seems only too appropriate.  To `promote&#039; -h out of du, df and ls into a separate utility would break scripts of users that depend on it.</description>
		<content:encoded><![CDATA[<p>Sat Jan 20 06:00:09 1996  Jim Meyering  (&#8212;&#8212;@na-net.ornl.gov)</p>
<p>	&#8212;snip&#8212;</p>
<p>	* du.c (main): New options &#8211;human-readable (-h) and &#8211;megabytes (-m).<br />
	(human_readable): New function.<br />
        From Larry McVoy (&#8212;&#8212;@sgi.com).</p>
<p>Ever since this patch was included in fileutils, system administrators have been frustrated by finding that while they could `du -h` they could not then `sort -h` the output.  -h is not posix but is now solidly a part of the gnu coreutils du and ls commands.  Including a switch for sort that respects the switch for du was not my invention.  It has been argued a number of times on the developers mailing list.  Mine was simply the straw which broke the camels back.  The additional switch is consistent with the other tools, and merely augments the purpose of sort without creating a differing utility to it.</p>
<p>Something of the functionality of `hu` may have been the appropriate fix in &#8216;96, but since the &#8216;96 -h switch is long set, adding a corresponding switch to sort seems only too appropriate.  To `promote&#8217; -h out of du, df and ls into a separate utility would break scripts of users that depend on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gordon Mohr</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-46</link>
		<dc:creator>Gordon Mohr</dc:creator>
		<pubDate>Sun, 17 May 2009 23:11:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-46</guid>
		<description>Why not promote the &#039;human-readability&#039; step to a standalone utility?

Let&#039;s call it &#039;hu&#039; for &#039;human units&#039;. Hypothetically, it would convert any whitespace-delimited numbers found on stdin to human-readable units when echoing to stdout. (Optional arguments could limit this conversion to just certain fields or to alternate unit systems.) Then the solution would be:

  du -sb * &#124; sort -n &#124; hu</description>
		<content:encoded><![CDATA[<p>Why not promote the &#8216;human-readability&#8217; step to a standalone utility?</p>
<p>Let&#8217;s call it &#8216;hu&#8217; for &#8216;human units&#8217;. Hypothetically, it would convert any whitespace-delimited numbers found on stdin to human-readable units when echoing to stdout. (Optional arguments could limit this conversion to just certain fields or to alternate unit systems.) Then the solution would be:</p>
<p>  du -sb * | sort -n | hu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-31</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Fri, 15 May 2009 07:04:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-31</guid>
		<description>Thanks to inataysia on reddit for a bash only version

&lt;code&gt;du -sk * &#124; sort -n &#124; while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e &quot;${size}${unit}\t${fname}&quot;; break; fi; size=$((size/1024)); done; done&lt;/code&gt;

</description>
		<content:encoded><![CDATA[<p>Thanks to inataysia on reddit for a bash only version</p>
<p><code>du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DVoita</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-30</link>
		<dc:creator>DVoita</dc:creator>
		<pubDate>Fri, 15 May 2009 06:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-30</guid>
		<description>If you modify &lt;em&gt;du -sk *&lt;/em&gt; to &lt;em&gt;du -sk * .??*&lt;/em&gt; you can see hidden dot files as well.</description>
		<content:encoded><![CDATA[<p>If you modify <em>du -sk *</em> to <em>du -sk * .??*</em> you can see hidden dot files as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fire</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-29</link>
		<dc:creator>fire</dc:creator>
		<pubDate>Fri, 15 May 2009 06:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-29</guid>
		<description>I use the following... you see it use &#039;du&#039; two times, but this is not really slower, &#039;cause the operating system caches.

# sorted du -hsc
function duhs() {
    du -s $* &#124; sort -n &#124; cut -f 2- &#124; while read a; do du -sh $a; done
}</description>
		<content:encoded><![CDATA[<p>I use the following&#8230; you see it use &#8216;du&#8217; two times, but this is not really slower, &#8217;cause the operating system caches.</p>
<p># sorted du -hsc<br />
function duhs() {<br />
    du -s $* | sort -n | cut -f 2- | while read a; do du -sh $a; done<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Volnitsky</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-28</link>
		<dc:creator>Leonid Volnitsky</dc:creator>
		<pubDate>Fri, 15 May 2009 05:08:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-28</guid>
		<description>Latest version of sort (part of coreutils) supports -h (correct sorting of M,k,G suffixes).</description>
		<content:encoded><![CDATA[<p>Latest version of sort (part of coreutils) supports -h (correct sorting of M,k,G suffixes).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/comment-page-1/#comment-27</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 15 May 2009 04:50:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.earthinfo.org/?p=402#comment-27</guid>
		<description>@casper

I don&#039;t.

I prefer not to pay an additional cost on every write, to speed up this far-less-frequent case.</description>
		<content:encoded><![CDATA[<p>@casper</p>
<p>I don&#8217;t.</p>
<p>I prefer not to pay an additional cost on every write, to speed up this far-less-frequent case.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
