Subject: bug#39850: "du" command can not count some files

From: Hyunho Cho<[email-masked]>
Date: Sun, 01 Mar 2020 16:13:46 +0900

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:        19.10
Codename:       eoan

$ uname -a
Linux EliteBook 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ du --version
du (GNU coreutils) 8.30

====================================================================================

$ find /usr/bin -type f | wc -l
2234

$ find /usr/bin -type f -print0 | du -b --files0-from=- | wc -l
2222

$ du -b $( find /usr/bin -type f ) | wc -l
2222

$ find /usr/bin -type f -exec stat -c %s {} + | awk '{sum+=$1} END{ print sum}'
1296011570

$ find /usr/bin -type f -print0 | du -b --files0-from=- | awk '{sum+=$1} END{ print sum}'
1282350388

$ diff <( find /usr/bin -type f | sort ) <( find /usr/bin -type f -print0 | du --files0-from=-  | cut -f 2  | sort )
1231d1230
< /usr/bin/perl5.28.1
1233d1231
< /usr/bin/perlbug
1262d1259
< /usr/bin/pigz
1272d1268
< /usr/bin/pkg-config
1517,1518d1512
< /usr/bin/python3.6m
< /usr/bin/python3.7
1619d1612
< /usr/bin/rb
1697d1689
< /usr/bin/rz
1727d1718
< /usr/bin/sb
1893d1883
< /usr/bin/sz
1932d1921
< /usr/bin/tiptop
1990d1978
< /usr/bin/unzip