From unknown Sat Jun 14 02:02:52 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12312 <12312@debbugs.gnu.org> To: bug#12312 <12312@debbugs.gnu.org> Subject: Status: Feature Request: du -h or du --si sort by human readable value Reply-To: bug#12312 <12312@debbugs.gnu.org> Date: Sat, 14 Jun 2025 09:02:52 +0000 retitle 12312 Feature Request: du -h or du --si sort by human readable value reassign 12312 coreutils submitter 12312 kat amsterdam severity 12312 wishlist tag 12312 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 30 15:13:03 2012 Received: (at submit) by debbugs.gnu.org; 30 Aug 2012 19:13:03 +0000 Received: from localhost ([127.0.0.1]:58424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T7AAo-0006sf-Ih for submit@debbugs.gnu.org; Thu, 30 Aug 2012 15:13:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46556) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T79fb-00069q-QH for submit@debbugs.gnu.org; Thu, 30 Aug 2012 14:40:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T79eR-0001hG-Bz for submit@debbugs.gnu.org; Thu, 30 Aug 2012 14:39:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:44153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T79eR-0001gz-7o for submit@debbugs.gnu.org; Thu, 30 Aug 2012 14:39:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T79eP-00011G-Oi for bug-coreutils@gnu.org; Thu, 30 Aug 2012 14:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T79eO-0001bj-AQ for bug-coreutils@gnu.org; Thu, 30 Aug 2012 14:39:33 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:60655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T79eN-0001bD-Tf for bug-coreutils@gnu.org; Thu, 30 Aug 2012 14:39:32 -0400 Received: by wibhq4 with SMTP id hq4so524984wib.12 for ; Thu, 30 Aug 2012 11:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=7ktfOKsQJiZLXrEXzzeIimXgtaKg0qpbACM69zkTyII=; b=ftCVzjYtOo923qOn/z6uKpdTJ5LEIUAsKDfCL/lg/nqW21YKbkU8B6HGRuUBQ/hAAP VDwpzqcpiqfaP0HQoDwl3SM0Hb8f3Jtyf8R9Wp5OTbV280MfktQ3tyKTST0MbHwYek7w TFEPl6j6RztPaeh7Cvzk8+jX50WrMqqCUZrH4+iwdkFPbh4sVLnCGd7Wu1rJCrr1DUjV kv/RzZD0eUPGIWaAnY90yanV7RbpYVVbDmdMFmgjMbWeORuwcmvri23GPzV6CVhr0VEp Kc5LcVNg6VQFv4Ov9gFsYqIbSfxj6pGIQCWdUuyreS5LPLjPwsW+FRQOmPx7hBkOX7aj p+Ag== Received: by 10.216.241.202 with SMTP id g52mr3529482wer.212.1346351967916; Thu, 30 Aug 2012 11:39:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.3.13 with HTTP; Thu, 30 Aug 2012 11:39:07 -0700 (PDT) From: kat amsterdam Date: Thu, 30 Aug 2012 20:39:07 +0200 Message-ID: Subject: Feature Request: du -h or du --si sort by human readable value To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=e0cb4e43d0a9ca53e904c87ffeb5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 30 Aug 2012 15:13:02 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --e0cb4e43d0a9ca53e904c87ffeb5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi GNU core utility developers: First of all thank you very much for developing the software that we have come to rely on. It's well appreciated! I have a feature request based on a question that was asked on askubuntu.co= m the question is: why does du -h not sort by the human readable value. Example: 1) du returns random sort order *du -h /home/user/Photos* 156M /home/user/Photos/cats 124M /home/user/Photos/vacation 1G /home//user/Photos/family 148K /home/user/Photos/profile 2) du returns sorted by number but not by acutal value in this example G is large than M and M is larger than K *du -h /home/user/Photos | sort -n * 1G /home//user/Photos/family 124M /home/user/Photos/vacation 148K /home/user/Photos/profile 156M /home/user/Photos/cats 3) this works partially but is very difficult to remember du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh | head -n 10 4) This is even more ridiculous, computers are supposed to do the work for us, not make attempt impossible memorization tasks. alias duf=3D'du -sk * | sort -n | perl -ne '\''($s,$f)=3Dsplit(m{\t});for (qw(K M G)) {if($s<1024) {printf("%.1f",$s);print "$_\t$f"; last};$s=3D$s/1024}'\' Please add a sorting function to du -h and du --si to sort the human readable values to make your wonderful utility even more useful. This is program one time, and it's done for everyone. The entire GNU and linux communities will be beter for this time saving feature. --=20 Met vriendelijke groet, Dami=C3=B6n la Bagh Amsterdam, Nederland =3D=3D globe*one*** Point of sale solutions for Retail and Horeca --e0cb4e43d0a9ca53e904c87ffeb5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi GNU core utility developers:

First of all thank you v= ery much for developing the software that we have come to rely on. It's= well appreciated!

I have a feature request based = on a question that was asked on askubuntu.= com

the question is: why does du=C2=A0-h =C2=A0not sort by the human readable va= lue.

Example:

1) du=C2=A0returns random sort order=C2=A0
du<= /span> -h /home/user/Photos

156M /home/user/Photos/cats
124M /home/user/P= hotos/vacation
1G =C2=A0 /home//user/Photos/family
148K= =C2=A0/home/user/Photos/profile


2)= du=C2=A0returns sorted by number but not by acutal value in this example G is large t= han M and M is larger than K
du=C2=A0-h= /home/user/Photos | sort -n=C2=A0

1G =C2=A0 /home//user/Photos/family
124M /home/user/Photos/vacation
148K =C2=A0/home/user/Photos= /profile
156M /home/user/Photos/cats

3) = this works partially but is very difficult to remember= =C2=A0

du -k * | sort -nr | cut -f2 |=
 xargs=
 d '\n' du -sh | head -n 10
4) This is even more ridiculous, computers are supposed to do th= e work for us, not make attempt impossible memorization tasks.
alias duf=3D'du -sk * | sort -n | perl -ne = '\''($s,$f)=3Dsplit(m{\t});for <= span class=3D"pun" style=3D"margin:0px;padding:0px;border:0px;font-size:14p= x;vertical-align:baseline;background-color:transparent;color:black">(qw(<= /span>= K M G)) {if($s<1024) {printf("%.1f",<= /span>= $s);print "$_\t$f"; last};$s=3D$s/1024}'\&#= 39;

Please add a sorting function to du=C2=A0-h and du=C2=A0--si to sort the human readable values to make your wonderful utilit= y even more useful.
=C2=A0
This is program one time, and it's done for every= one. The entire GNU and linux=C2=A0communities will be= beter for this time saving feature.

--=C2=A0
Met vriendelijke groet,
Dami=C3=B6n la= Bagh
Amsterdam, Nederland
=3D=3D
globeone=
Point of sale solutions for Retail and Horeca
--e0cb4e43d0a9ca53e904c87ffeb5-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 30 16:21:56 2012 Received: (at control) by debbugs.gnu.org; 30 Aug 2012 20:21:56 +0000 Received: from localhost ([127.0.0.1]:58472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T7BFU-0001eK-AC for submit@debbugs.gnu.org; Thu, 30 Aug 2012 16:21:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35226) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T7BFQ-0001e3-25; Thu, 30 Aug 2012 16:21:54 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7UKKYmG014336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 30 Aug 2012 16:20:39 -0400 Received: from [10.3.113.110] (ovpn-113-110.phx2.redhat.com [10.3.113.110]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7UKKXmq007512; Thu, 30 Aug 2012 16:20:34 -0400 Message-ID: <503FCB10.6070802@redhat.com> Date: Thu, 30 Aug 2012 13:20:32 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: kat amsterdam Subject: Re: bug#12312: Feature Request: du -h or du --si sort by human readable value References: In-Reply-To: X-Enigmail-Version: 1.4.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigE89F5A65F8912C01B9CDD768" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -7.1 (-------) X-Debbugs-Envelope-To: control Cc: control@debbugs.gnu.org, 12312-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.1 (-------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE89F5A65F8912C01B9CDD768 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 12312 notabug thanks On 08/30/2012 11:39 AM, kat amsterdam wrote: > Hi GNU core utility developers: >=20 > First of all thank you very much for developing the software that we ha= ve > come to rely on. It's well appreciated! Thank you. >=20 > I have a feature request based on a question that was asked on askubunt= u.com >=20 > the question is: why does du -h not sort by the human readable value. du(1) doesn't sort, you use sort(1) for sorting. > 1) du returns random sort order > *du -h /home/user/Photos* to get it in sorted order, du -h /home/user/Photos* | sort -k1,1h > 2) du returns sorted by number but not by acutal value in this example = G is > large than M and M is larger than K > *du -h /home/user/Photos | sort -n * Don't use sort -n, use sort -h. >=20 > Please add a sorting function to du -h and du --si to sort the human > readable values to make your wonderful utility even more useful. >=20 We already have: sort -h, in coreutils 7.5 (2009). Therefore, I'm closing this bug. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigE89F5A65F8912C01B9CDD768 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQP8sQAAoJEKeha0olJ0NqEiIIAII4CE+V5E+93IpTOt1roN4R TqoY6UIRu8Q5oup7d60wtdcPw8lThQUYLJUb5fp4r1QFwzPegHWwL+ds8zSgIFh0 R1LQ4uavHj37kdZLdkIND6q1ConCSg9n2+2zaLWOIsLnWI7hEBaOD3oDPrXM41j6 7ZNBimZzjgo9h+IbgyCWmGl1exgMcuYSJb0ebMVXG5tjgIK4W+nhx/dFRtHBpMRn jwpSjVZm35Lo/LbskkxbMm1U4YHjDoJT5GU8HGd6rxbXiKllPcyoT6YxUF3F71DK S6mIzEk21RF9AK0wRPBZDlkDeq9VPHffiWMBnKIgsXoqiV1q0uLCLYGw1GW81dI= =+Bth -----END PGP SIGNATURE----- --------------enigE89F5A65F8912C01B9CDD768-- From unknown Sat Jun 14 02:02:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 28 Sep 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator