Why do du -s * and du -s . show vastly different sizes?
I ran both du -sh .
and du -sh *
inside a directory, but the values returned by the second one don't add up to nearly the same value reported by the first. 5.7GB vs 1.5 GB. Why is this? Are there some files that the *
misses?
$ du -s .
5926440 .
$ du -s *
4 Desktop
4 Documents
4 Downloads
8544 video.avi
4 Music
2516 output.mkv
4 packages-microsoft-prod.deb
4 Pictures
4 Public
1513440 repos
52 snap
20 Templates
4 Videos
(reposted from StackOverflow since it's more appropriate here)
Solution 1:
The *
glob excludes hidden files by default. du -hd1 .
shows the expected results - the size adds up to the total shown by du -sh .