When I run the bash command du -hs .
, the output is
1.2G .
When I run the bash command du -hs *
, the output is
108K action
4.0K activate.php
8.0K browse.php
584K captcha
164K class
4.0K clearcache
388K cms
4.0K comment.complete.php
4.0K contact.php
530M docs
116K documentation
24K DONE.txt
21M em
4.0K footer.php
4.0K forgot.php
4.0K header.php
196K images
264K includes
8.0K index.php
168K js
4.0K login.php
4.0K logout.php
4.0K mail.confirmation.php
4.0K mail.php
4.0K news.item.php
4.0K news.php
4.0K profile.edit.php
4.0K profile.php
4.0K reset.confirmation.php
4.0K robots.txt
4.0K signup.confirmation.php
4.0K signup.php
4.0K svnstatus
4.0K svnunknown
4.0K TODO.txt
16M tpl
If you add up all the file and dir size of the du -hs *
output, it's about 600MB short of the du -hs .
command. How do I figure out what's causing the 600MB? And why is there such a big discrepancy between the two commands?
The
du -hs *
command will only report on files which will match that wildcard. That wildcard will not include any files or directories that begin with a period.The
dh -sh
command will check.
(the current directory) so it will check everything under that directory, including any files beginning with a period.For example:
An aside:
To make things easier, instead of
du -hs *
usedu -hsc *
. It will provide a total so you don't have to add it up manually.