Size of directories only not files
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
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
add a comment |
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
du -h -c -d0 Downloads/*/
lists the size of all directories inDownloads
also includes total.
– Ravexina
Mar 31 at 9:15
Thank you!!! I useddu -shc *
which worked perfectly with your help.
– Maverick32
Mar 31 at 10:14
add a comment |
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
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
command-line 18.04 files filesystem
asked Mar 31 at 8:50
Maverick32Maverick32
876
876
du -h -c -d0 Downloads/*/
lists the size of all directories inDownloads
also includes total.
– Ravexina
Mar 31 at 9:15
Thank you!!! I useddu -shc *
which worked perfectly with your help.
– Maverick32
Mar 31 at 10:14
add a comment |
du -h -c -d0 Downloads/*/
lists the size of all directories inDownloads
also includes total.
– Ravexina
Mar 31 at 9:15
Thank you!!! I useddu -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
add a comment |
1 Answer
1
active
oldest
votes
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 addeddu -shc *
and worked exactly as i hoped. Thank you!
– Maverick32
Mar 31 at 10:15
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 addeddu -shc *
and worked exactly as i hoped. Thank you!
– Maverick32
Mar 31 at 10:15
add a comment |
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 addeddu -shc *
and worked exactly as i hoped. Thank you!
– Maverick32
Mar 31 at 10:15
add a comment |
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.
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.
answered Mar 31 at 9:50
EliasElias
1217
1217
1
Perfect!! I addeddu -shc *
and worked exactly as i hoped. Thank you!
– Maverick32
Mar 31 at 10:15
add a comment |
1
Perfect!! I addeddu -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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
du -h -c -d0 Downloads/*/
lists the size of all directories inDownloads
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