Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get size of hidden files with "du"

I've been using "du -hs ~/" to get the size of my total home directory with outputs 20GB, and I've been trying to where large files that I can delete to free up some space. However, when using "du -hs ~/*" I get numerous outputted files but they don't sum to 20GB. There are a few hidden files but they aren't shown.

How can I print out the size of hidden files, and also locate the largest files/directories via command line?

Thank you!

like image 588
AlphaBetaGamma96 Avatar asked Feb 02 '26 08:02

AlphaBetaGamma96


1 Answers

To size all the files in home directories including hidden files

du -sh $(ls -A)
du -sh .[^.]* *

To size only normal files

du -sh *

To size only hidden files

du -sh .[^.]*
like image 160
Alok Avatar answered Feb 04 '26 00:02

Alok



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!