This is a discussion on Re: PATCH: df(1) -m option for reports in megabytes within the mailing.openbsd.tech forums, part of the OpenBSD category; --> On Tue, Apr 17, 2007 at 09:30:01PM +0200, Jakub G?azik wrote: | I have noticed lack of -m option ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Tue, Apr 17, 2007 at 09:30:01PM +0200, Jakub G?azik wrote: | I have noticed lack of -m option in OpenBSD's df(1) long time ago, | but I could live without it.. until now. So here's a SIMPLE patch to add | it. Now `df -m` reports numbers in megabytes, which can be more readable | than sectors/kilobytes and has better "resolution" than -h which usually | reports numbers in gigabytes to fit the 4 char limit. | | Why no -g option? Cause the weather was too sunny today and my disk has | only 40 gigs ;-) | | I've looked how netbsd and freebsd do it - well, both do it differently | and more complicated than our df(1), and rewriting this would be against | KISS rule. So no -g for now. | | I think this patch isn't bloat and it will make our lives better. | Am I right? Apart from the to-the-point replies you've already received, people seem to forget that df already supports outputting in megabytes. Or gigabytes, for that matter (so when you upgrade from your 40G drive, you can still see gigabyte-df-output). It's even documented in the manpage. $ BLOCKSIZE=$((1024*1024)) df . Filesystem 1048576-blocks Used Avail Capacity Mounted on /dev/sd0m 23209 6451 15597 29% /home $ BLOCKSIZE=$((1024*1024*1024)) df . Filesystem 1073741824-blocks Used Avail Capacity Mounted on /dev/sd0m 22 6 15 29% /home OpenBSD has excellent manpages, you know this because your patch included the necessary changes to /cvs/src/bin/df/df.1, it was already there ! If it weren't for the standard specification, I would almost argue for removing -k. Cheers, Paul 'WEiRD' de Weerd [demime 1.01d removed an attachment of type application/pgp-signature] |