Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Andreas Kusalananda Kähäri
On Wed, Jan 29, 2020 at 06:38:31PM +0100, Ingo Schwarze wrote: > Hi Andreas, > > Andreas Kusalananda wrote on Wed, Jan 29, 2020 at 06:09:54PM +0100: > > On Wed, Jan 29, 2020 at 05:48:44PM +0100, Ingo Schwarze wrote: > > >> +.Dl du -sh * .??* | sort -h > > > Why the ".??*"? That would miss

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Ingo Schwarze
Hi Andreas, Andreas Kusalananda wrote on Wed, Jan 29, 2020 at 06:09:54PM +0100: > On Wed, Jan 29, 2020 at 05:48:44PM +0100, Ingo Schwarze wrote: >> +.Dl du -sh * .??* | sort -h > Why the ".??*"? That would miss single (well, double) letter hidden > directory names like .a, .b etc. True, but

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Andreas Kusalananda Kähäri
On Wed, Jan 29, 2020 at 05:48:44PM +0100, Ingo Schwarze wrote: > Hi Jason, > > Jason McIntyre wrote on Wed, Jan 29, 2020 at 04:26:42PM +: > > > i don;t think it would be such a bad thing for du to have an example or > > two, so i'm ok with this. > > > > so sth like: > > > > Display a

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Jason McIntyre
On Wed, Jan 29, 2020 at 05:48:44PM +0100, Ingo Schwarze wrote: > Hi Jason, > > Jason McIntyre wrote on Wed, Jan 29, 2020 at 04:26:42PM +: > > > i don;t think it would be such a bad thing for du to have an example or > > two, so i'm ok with this. > > > > so sth like: > > > > Display a

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Jason McIntyre
On Wed, Jan 29, 2020 at 10:46:28AM -0600, Scott Cheloha wrote: > > On Jan 29, 2020, at 10:26 AM, Jason McIntyre wrote: > > > > On Wed, Jan 29, 2020 at 11:12:56AM -0500, David Goerger wrote: > >> Monday, 20200127 18:29-0500, Daniel Jakots wrote: > >>> Can't you achieve what you want with `du -sh

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Ingo Schwarze
Hi Jason, Jason McIntyre wrote on Wed, Jan 29, 2020 at 04:26:42PM +: > i don;t think it would be such a bad thing for du to have an example or > two, so i'm ok with this. > > so sth like: > > Display a summary of files and folders in the current directory, > sorted by size: >

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Scott Cheloha
> On Jan 29, 2020, at 10:26 AM, Jason McIntyre wrote: > > On Wed, Jan 29, 2020 at 11:12:56AM -0500, David Goerger wrote: >> Monday, 20200127 18:29-0500, Daniel Jakots wrote: >>> Can't you achieve what you want with `du -sh * | sort -h`? du(1)'s >>> -h options will automatically select the best

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Jason McIntyre
On Wed, Jan 29, 2020 at 11:12:56AM -0500, David Goerger wrote: > Monday, 20200127 18:29-0500, Daniel Jakots wrote: > > Can't you achieve what you want with `du -sh * | sort -h`? du(1)'s > > -h options will automatically select the best suffix and sort(1)'s > > -h will sort first using the suffix

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread David Goerger
Monday, 20200127 18:29-0500, Daniel Jakots wrote: > Can't you achieve what you want with `du -sh * | sort -h`? du(1)'s > -h options will automatically select the best suffix and sort(1)'s > -h will sort first using the suffix then the numerical value. Thanks! I didn't know about "sort -h". That

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Lauri Tirkkonen
On Wed, Jan 29 2020 12:25:34 +0100, Sebastian Benoit wrote: > Lauri Tirkkonen(la...@hacktheplanet.fi) on 2020.01.29 01:31:56 +0200: > > On Tue, Jan 28 2020 18:03:19 +0100, Florian Obser wrote: > > > On Tue, Jan 28, 2020 at 09:58:40AM -0700, Todd C. Miller wrote: > > > > On Mon, 27 Jan 2020

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-29 Thread Sebastian Benoit
Lauri Tirkkonen(la...@hacktheplanet.fi) on 2020.01.29 01:31:56 +0200: > On Tue, Jan 28 2020 18:03:19 +0100, Florian Obser wrote: > > On Tue, Jan 28, 2020 at 09:58:40AM -0700, Todd C. Miller wrote: > > > On Mon, 27 Jan 2020 18:29:39 -0500, Daniel Jakots wrote: > > > > > > > Can't you achieve what

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-28 Thread Lauri Tirkkonen
On Tue, Jan 28 2020 18:03:19 +0100, Florian Obser wrote: > On Tue, Jan 28, 2020 at 09:58:40AM -0700, Todd C. Miller wrote: > > On Mon, 27 Jan 2020 18:29:39 -0500, Daniel Jakots wrote: > > > > > Can't you achieve what you want with `du -sh * | sort -h`? du(1)'s -h > > > options will automatically

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-28 Thread Florian Obser
On Tue, Jan 28, 2020 at 09:58:40AM -0700, Todd C. Miller wrote: > On Mon, 27 Jan 2020 18:29:39 -0500, Daniel Jakots wrote: > > > Can't you achieve what you want with `du -sh * | sort -h`? du(1)'s -h > > options will automatically select the best suffix and sort(1)'s -h > > will sort first using

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-28 Thread Todd C . Miller
On Mon, 27 Jan 2020 18:29:39 -0500, Daniel Jakots wrote: > Can't you achieve what you want with `du -sh * | sort -h`? du(1)'s -h > options will automatically select the best suffix and sort(1)'s -h > will sort first using the suffix then the numerical value. Yes, I forgot about "sort -h". Old

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-27 Thread Todd C . Miller
On Tue, 28 Jan 2020 15:00:39 +1100, Jonathan Gray wrote: > There are several commands which have a -k flag for scaling to > kilobytes. > > For example: > df > du > ls > pstat > quot > swapctl > > Going down the list of unit names kmgtpezy some of these flags are > already used. So it would be

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-27 Thread Jonathan Gray
On Mon, Jan 27, 2020 at 10:34:56PM +0100, Sebastian Benoit wrote: > Florian Obser(flor...@openbsd.org) on 2020.01.27 19:57:41 +0100: > > On Mon, Jan 27, 2020 at 10:33:49AM -0700, Todd C. Miller wrote: > > > On Mon, 27 Jan 2020 10:05:41 +1100, Jonathan Gray wrote: > > > > > > > On Sun, Jan 26,

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-27 Thread Daniel Jakots
On Mon, 27 Jan 2020 10:33:49 -0700, Todd C. Miller wrote: > For example, I often do: > > du -sk * | sort -rn | head > > to see the largest disk users. > > However, output in kilobytes is less useful than it used to be due > to larger files now being common. Can't you achieve what you

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-27 Thread Sebastian Benoit
Florian Obser(flor...@openbsd.org) on 2020.01.27 19:57:41 +0100: > On Mon, Jan 27, 2020 at 10:33:49AM -0700, Todd C. Miller wrote: > > On Mon, 27 Jan 2020 10:05:41 +1100, Jonathan Gray wrote: > > > > > On Sun, Jan 26, 2020 at 11:59:33AM -0500, David Goerger wrote: > > > > This diff teaches du(1)

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-27 Thread Florian Obser
On Mon, Jan 27, 2020 at 10:33:49AM -0700, Todd C. Miller wrote: > On Mon, 27 Jan 2020 10:05:41 +1100, Jonathan Gray wrote: > > > On Sun, Jan 26, 2020 at 11:59:33AM -0500, David Goerger wrote: > > > This diff teaches du(1) the -m flag, report disk usage in megabytes. > > > This brings us in line

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-27 Thread Todd C . Miller
On Mon, 27 Jan 2020 10:05:41 +1100, Jonathan Gray wrote: > On Sun, Jan 26, 2020 at 11:59:33AM -0500, David Goerger wrote: > > This diff teaches du(1) the -m flag, report disk usage in megabytes. > > This brings us in line with implementations in the other BSDs, Linux, > > and Illumos. > > Why

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-26 Thread David Goerger
Monday, 20200127 10:05+1100, Jonathan Gray wrote: > On Sun, Jan 26, 2020 at 11:59:33AM -0500, David Goerger wrote: > > This diff teaches du(1) the -m flag, report disk usage in megabytes. > > This brings us in line with implementations in the other BSDs, Linux, > > and Illumos. > > Why is it

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-26 Thread Ted Unangst
Jonathan Gray wrote: > On Sun, Jan 26, 2020 at 11:59:33AM -0500, David Goerger wrote: > > This diff teaches du(1) the -m flag, report disk usage in megabytes. > > This brings us in line with implementations in the other BSDs, Linux, > > and Illumos. > > Why is it needed? -k is required by

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-26 Thread Jonathan Gray
On Sun, Jan 26, 2020 at 11:59:33AM -0500, David Goerger wrote: > This diff teaches du(1) the -m flag, report disk usage in megabytes. > This brings us in line with implementations in the other BSDs, Linux, > and Illumos. Why is it needed? -k is required by POSIX, adding arguments for

Re: Teach du(1) the -m flag, disk usage in megabytes

2020-01-26 Thread Sebastian Benoit
Maybe the manpage text could be better, but i'll leave that to jmc@ ok benno@ David Goerger(da...@goerger.info) on 2020.01.26 11:59:33 -0500: > This diff teaches du(1) the -m flag, report disk usage in megabytes. > This brings us in line with implementations in the other BSDs, Linux, > and

Teach du(1) the -m flag, disk usage in megabytes

2020-01-26 Thread David Goerger
This diff teaches du(1) the -m flag, report disk usage in megabytes. This brings us in line with implementations in the other BSDs, Linux, and Illumos. Other base utilities where this flag might be useful include df(1) and quot(8), although it doesn't appear to be universally adopted among the