Unix Technical Forum

Re: PATCH: df(1) -m option for reports in megabytes

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 09:20 AM
Paul de Weerd
 
Posts: n/a
Default Re: PATCH: df(1) -m option for reports in megabytes

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]

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:45 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com