Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionNoel McLoughlin
2016-02-02 14:42:33 UTC
+++ This bug was initially created as a clone of Bug #1303795 +++
+++ Cloned to RHEL7 on recommendation of Centos developer: #10296 +++
Description of problem:
sort(1) in coreutils 8.24 has an OPTION to check for strict ordering.
-u, --unique
with -c, check for strict ordering; without -c, output only the first of an equal run
However, df(1) in coreutils 8.24 has no OPTION to check for strict ordering.
This is inconsistent considering both df and sort reside in same coreutils package, and generated df output can contain duplicates.
Feature Request: The df utility should support strict ordering OPTION (-u).
Version-Release number of selected component (if applicable):
coreutils-8.24,
How reproducible:
Always
Steps to Reproduce:
1. # cd /
2. Execute these commands to see duplicates in output:
# df *
# df /*
# df bin lib lib64 sbin
3. Execute these commands for some nonsensical totals:
# cd /
# df --totals *
# df --totals /l*
# df --totals bin lib lib64 sbin
Expected results:
N/A
Additional info:
--- Additional comment from Noel McLoughlin on 2016-02-02 04:24:55 EST ---
Example of non intuitive output for directory containing 7 files.
7423bfmp:~/workspace/ISO\ ]$ df * --total
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/my_vg-root 163012068 138180884 16527568 90% /
/dev/mapper/my_vg-root 163012068 138180884 16527568 90% /
/dev/mapper/my_vg-root 163012068 138180884 16527568 90% /
/dev/mapper/my_vg-root 163012068 138180884 16527568 90% /
/dev/mapper/my_vg-root 163012068 138180884 16527568 90% /
/dev/mapper/my_vg-root 163012068 138180884 16527568 90% /
/dev/mapper/my_vg-root 163012068 138180884 16527568 90% /
total 1141084476 967266188 115692976 90% -
Thanks Noel for bringing this to upstream mailing list.
** The only feedback from coreutils is from Bernhard Voelker ***
<quote>
I'm not too enthusiastic for such an option. This is the first time
I've seen someone doing "df *". Although it doesn't seem to be explicitly
specified by POSIX, I'd assume a consistent behavior like many other tools
which do their job for each command line argument regardless whether it
may make sense (stat, du) or maybe not (df, dirname).
Furthermore, since the introduction of the output field 'file', it really
makes sense to not unify the output:
$ df -h --out=source,target,file df du mv
Filesystem Mounted on File
/dev/sda5 /media/big_data df
/dev/sda5 /media/big_data du
/dev/sda5 /media/big_data mv
A --unique option would clash with this output format.
Finally, I'm not sure if everyone is aware that also regular files can
be a mount point (admittedly, the output of 'findmnt' is a little more
useful in this case):
$ touch a b c
$ mount --bind /proc/cpuinfo b
$ mount --bind /sys/kernel/notes c
$ df -h a b c
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 20G 14G 5.2G 73% /
proc 0 0 0 - /root/tmp/b
sysfs 0 0 0 - /root/tmp/c
Still, when 2 lines are really identical (because they are on the
same file system and not mounted over), it may be valid to squeeze
the output, but I don't think this is following the principle of
least suprise: someone might be confused why some lines are missing
... or even relying on that in a script. Anyway, one may simply
do that with "... | sort -u" if needed.
Have a nice day,
Berny
</quote>
Based on this, keeping opened to possibly adjust info documentation in some of the future updates. This is not something we can implement as downstream patch.
The output of "df *" is not non-intuitive. It is just useless in most of the cases. You are welcome to send a proposal to the bug-coreutils mailing list.