Size of directories only not files





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







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










share|improve this question























  • 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


















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










share|improve this question























  • 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














4












4








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










share|improve this question














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







command-line 18.04 files filesystem






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 31 at 8:50









Maverick32Maverick32

876




876













  • 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



















  • 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

















du -h -c -d0 Downloads/*/ lists the size of all directories in Downloads also includes total.

– Ravexina
Mar 31 at 9:15







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





Thank you!!! I used du -shc * which worked perfectly with your help.

– Maverick32
Mar 31 at 10:14










1 Answer
1






active

oldest

votes


















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.






share|improve this answer



















  • 1





    Perfect!! I added du -shc * and worked exactly as i hoped. Thank you!

    – Maverick32
    Mar 31 at 10:15












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130092%2fsize-of-directories-only-not-files%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









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.






share|improve this answer



















  • 1





    Perfect!! I added du -shc * and worked exactly as i hoped. Thank you!

    – Maverick32
    Mar 31 at 10:15
















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.






share|improve this answer



















  • 1





    Perfect!! I added du -shc * and worked exactly as i hoped. Thank you!

    – Maverick32
    Mar 31 at 10:15














2












2








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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 31 at 9:50









EliasElias

1217




1217








  • 1





    Perfect!! I added du -shc * and worked exactly as i hoped. Thank you!

    – Maverick32
    Mar 31 at 10:15














  • 1





    Perfect!! I added du -shc * and worked exactly as i hoped. Thank you!

    – Maverick32
    Mar 31 at 10:15








1




1





Perfect!! I added du -shc * and worked exactly as i hoped. Thank you!

– Maverick32
Mar 31 at 10:15





Perfect!! I added du -shc * and worked exactly as i hoped. Thank you!

– Maverick32
Mar 31 at 10:15


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130092%2fsize-of-directories-only-not-files%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?