Bug 183681

Summary: df(1): -h and -H option: manual page have them swapped
Product: Documentation Reporter: robin.hahling
Component: Books & ArticlesAssignee: Warren Block <wblock>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description robin.hahling 2013-11-05 12:20:00 UTC
The manual page of df(1) has the -h and -H options swapped.
The bug exists since 2012-11-16 and has been introduced by this commit (r243129):
http://lists.freebsd.org/pipermail/svn-src-all/2012-November/061588.html

-h option has historically been based on powers of 1024 whereas -H options on powers of 1000.

If you run the following:
% df -h; df -H
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2    112G    2.1G    101G     2%    /
devfs          1.0K    1.0K      0B   100%    /dev
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2    121G    2.3G    109G     2%    /
devfs          1.0k    1.0k      0B   100%    /dev

You can notice that sizes with -H are actually larger, hence based on powers of 1000.

Thus, the manual page have them wrong (swapped), since the aforementioned commit:
     -H      ``Human-readable'' output.  Use unit suffixes: Byte, Kibibyte,
             Mebibyte, Gibibyte, Tebibyte and Pebibyte (based on powers of
             1024) in order to reduce the number of digits to four or fewer.

     -h      ``Human-readable'' output.  Use unit suffixes: Byte, Kilobyte,
             Megabyte, Gigabyte, Terabyte and Petabyte (based on powers of
             1000) in order to reduce the number of digits to four or fewer.

How-To-Repeat: Have a look at the manual page and compare it with the output of df -h; df -H (or have a look at bin/df.c).
Comment 1 Warren Block freebsd_committer freebsd_triage 2014-01-16 17:00:58 UTC
Responsible Changed
From-To: freebsd-bugs->wblock

Take.
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-01-16 17:06:09 UTC
Author: wblock (doc committer)
Date: Thu Jan 16 17:06:02 2014
New Revision: 260782
URL: http://svnweb.freebsd.org/changeset/base/260782

Log:
  -h and -H options backwards in manual page.
  
  PR:		bin/183681 docs/183681
  Submitted by:	Robin Hahling <robin.hahling@gw-computing.net>
  MFC after:	3 days

Modified:
  head/bin/df/df.1

Modified: head/bin/df/df.1
==============================================================================
--- head/bin/df/df.1	Thu Jan 16 16:44:23 2014	(r260781)
+++ head/bin/df/df.1	Thu Jan 16 17:06:02 2014	(r260782)
@@ -29,7 +29,7 @@
 .\"     @(#)df.1	8.3 (Berkeley) 5/8/95
 .\" $FreeBSD$
 .\"
-.Dd January 24, 2013
+.Dd January 16, 2014
 .Dt DF 1
 .Os
 .Sh NAME
@@ -83,13 +83,13 @@ Use 1073741824 byte (1 Gibibyte) blocks 
 This overrides any
 .Ev BLOCKSIZE
 specification from the environment.
-.It Fl H
+.It Fl h
 .Dq Human-readable
 output.
 Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Tebibyte and
 Pebibyte (based on powers of 1024) in order to reduce the number of
 digits to four or fewer.
-.It Fl h
+.It Fl H
 .Dq Human-readable
 output.
 Use unit suffixes: Byte, Kilobyte, Megabyte,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-01-16 17:06:09 UTC
Author: wblock (doc committer)
Date: Thu Jan 16 17:06:02 2014
New Revision: 260782
URL: http://svnweb.freebsd.org/changeset/base/260782

Log:
  -h and -H options backwards in manual page.
  
  PR:		bin/183681 docs/183681
  Submitted by:	Robin Hahling <robin.hahling@gw-computing.net>
  MFC after:	3 days

Modified:
  head/bin/df/df.1

Modified: head/bin/df/df.1
==============================================================================
--- head/bin/df/df.1	Thu Jan 16 16:44:23 2014	(r260781)
+++ head/bin/df/df.1	Thu Jan 16 17:06:02 2014	(r260782)
@@ -29,7 +29,7 @@
 .\"     @(#)df.1	8.3 (Berkeley) 5/8/95
 .\" $FreeBSD$
 .\"
-.Dd January 24, 2013
+.Dd January 16, 2014
 .Dt DF 1
 .Os
 .Sh NAME
@@ -83,13 +83,13 @@ Use 1073741824 byte (1 Gibibyte) blocks 
 This overrides any
 .Ev BLOCKSIZE
 specification from the environment.
-.It Fl H
+.It Fl h
 .Dq Human-readable
 output.
 Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Tebibyte and
 Pebibyte (based on powers of 1024) in order to reduce the number of
 digits to four or fewer.
-.It Fl h
+.It Fl H
 .Dq Human-readable
 output.
 Use unit suffixes: Byte, Kilobyte, Megabyte,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 4 Warren Block freebsd_committer freebsd_triage 2014-01-20 23:28:58 UTC
State Changed
From-To: open->closed

Fix committed to -CURRENT and MFCed to 10-STABLE and 9-STABLE.