xxx@MacBook- ~/D/p/a/Project5_min> du -sh *
2.6M    app
4.0K    build.gradle
 60K    gradle
4.0K    gradle.properties
8.0K    gradlew
4.0K    gradlew.bat
4.0K    instruction.txt
4.0K    local.properties
4.0K    Project5.iml
4.0K    settings.gradle
xxx@MacBook-Pro ~/D/p/a/Project5_min> du -sh
 36M    .

I am trying to determine what is taking so much space in Project5 folder. I used du -sh * to get a list of all files and folders and their size. Then I used du -sh to determine the main folder size itself.

Space taken by the files listed after the firs command is around 2.7M, space taken by the main folder is 36M

36 - 2.7 = 33.3. What is happening with 33MB of space in this folder? How can I determine which file or folder is taking the missing memory?


I suspect you have hidden files or directories ie begining with .

If you do then du -sh * does not find them as * expands to the non hidden entries only.

Try du -h to show all the directories.

  • You are right, I did not realize that -sh * option is not showing hidden files. Thanks for your help. – kmb Jan 25 '19 at 17:22
  • 1
    If there are a lot of subfolders, you can use du -hd1 to list only the top-level directories. – Gordon Davisson Jan 25 '19 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.