4

This has probably been answered elsewhere but can't seem to find it and apologies for the duplicate/basic question.

I want to simply be able to display the file size of folders in a directory.

Running du -h lists all the folders but it also includes files in the directory. I'd prefer it to display similar to the below...

Documents Size mb Temp Size mb Pictures Size mb Videos Size mb Total size

Bonus if i could get the total at the end included. Is the possible through a simple command?

Thanks

  • du -h -c -d0 Downloads/*/ lists the size of all directories in Downloads also includes total. – Ravexina Mar 31 at 9:15
  • Thank you!!! I used du -shc * which worked perfectly with your help. – Maverick32 Mar 31 at 10:14
2

Try this:

du -sh *

The s option there means "summarize", to display only a total for each argument, and the * means you will get that for each directory (and file) where you stand.

  • 1
    Perfect!! I added du -shc * and worked exactly as i hoped. Thank you! – Maverick32 Mar 31 at 10:15

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.