How to see/determine on disk file size on Linux?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
1












On windows you can see the size actual size of a file/directory and the size on disk, this size on disk depends on block size.



How can I see this on Linux (mint)?



I have disk with thousands of pictures with varied sizes.



I want to see their actual size and the space they take up on disk, especially directories. On windows the difference can be in gigabytes of wasted space.







share|improve this question






















  • Do you plan on recreating your filesystem(s) based on the results, in order to reduce this wasted space? Otherwise, it's a fact of life for most filesystems.
    – Jeff Schaller
    Oct 14 '17 at 0:13










  • yes that is what i wanted, to reduce wasted space or even just make two partition with different block sizes, one for video and another for images. because I like the video playback benefits of having huge block sizes(or is it just a placebo effect).
    – user3130012
    Oct 15 '17 at 8:24














up vote
3
down vote

favorite
1












On windows you can see the size actual size of a file/directory and the size on disk, this size on disk depends on block size.



How can I see this on Linux (mint)?



I have disk with thousands of pictures with varied sizes.



I want to see their actual size and the space they take up on disk, especially directories. On windows the difference can be in gigabytes of wasted space.







share|improve this question






















  • Do you plan on recreating your filesystem(s) based on the results, in order to reduce this wasted space? Otherwise, it's a fact of life for most filesystems.
    – Jeff Schaller
    Oct 14 '17 at 0:13










  • yes that is what i wanted, to reduce wasted space or even just make two partition with different block sizes, one for video and another for images. because I like the video playback benefits of having huge block sizes(or is it just a placebo effect).
    – user3130012
    Oct 15 '17 at 8:24












up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





On windows you can see the size actual size of a file/directory and the size on disk, this size on disk depends on block size.



How can I see this on Linux (mint)?



I have disk with thousands of pictures with varied sizes.



I want to see their actual size and the space they take up on disk, especially directories. On windows the difference can be in gigabytes of wasted space.







share|improve this question














On windows you can see the size actual size of a file/directory and the size on disk, this size on disk depends on block size.



How can I see this on Linux (mint)?



I have disk with thousands of pictures with varied sizes.



I want to see their actual size and the space they take up on disk, especially directories. On windows the difference can be in gigabytes of wasted space.









share|improve this question













share|improve this question




share|improve this question








edited Oct 14 '17 at 0:37









peterh

3,97092755




3,97092755










asked Oct 13 '17 at 23:10









user3130012

183




183











  • Do you plan on recreating your filesystem(s) based on the results, in order to reduce this wasted space? Otherwise, it's a fact of life for most filesystems.
    – Jeff Schaller
    Oct 14 '17 at 0:13










  • yes that is what i wanted, to reduce wasted space or even just make two partition with different block sizes, one for video and another for images. because I like the video playback benefits of having huge block sizes(or is it just a placebo effect).
    – user3130012
    Oct 15 '17 at 8:24
















  • Do you plan on recreating your filesystem(s) based on the results, in order to reduce this wasted space? Otherwise, it's a fact of life for most filesystems.
    – Jeff Schaller
    Oct 14 '17 at 0:13










  • yes that is what i wanted, to reduce wasted space or even just make two partition with different block sizes, one for video and another for images. because I like the video playback benefits of having huge block sizes(or is it just a placebo effect).
    – user3130012
    Oct 15 '17 at 8:24















Do you plan on recreating your filesystem(s) based on the results, in order to reduce this wasted space? Otherwise, it's a fact of life for most filesystems.
– Jeff Schaller
Oct 14 '17 at 0:13




Do you plan on recreating your filesystem(s) based on the results, in order to reduce this wasted space? Otherwise, it's a fact of life for most filesystems.
– Jeff Schaller
Oct 14 '17 at 0:13












yes that is what i wanted, to reduce wasted space or even just make two partition with different block sizes, one for video and another for images. because I like the video playback benefits of having huge block sizes(or is it just a placebo effect).
– user3130012
Oct 15 '17 at 8:24




yes that is what i wanted, to reduce wasted space or even just make two partition with different block sizes, one for video and another for images. because I like the video playback benefits of having huge block sizes(or is it just a placebo effect).
– user3130012
Oct 15 '17 at 8:24










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










I think what you are looking for is du. Executing du -s <directory> shows you much disk space a directory's contents use up. du can also count the sizes of each file in the directory individually and tell you how big their total content is:



du -s --apparent-size <directory>



If you want to know the amount of "wasted" space resulting from allocation in blocks, just subtract the second command's result from the first's.



Note: --apparent-size reports the size in kilobytes. You can use the -b flag instead, if you want to know the exact number of bytes a file contains. This is useful if you want to know how many bytes (without headers and such) you would need to send over the network to deliver the file, for example.






share|improve this answer




















  • Thank you. du is what I was looking for. The combo. du -sh <directory> for space on disk du -b <directory> for actual size
    – user3130012
    Oct 15 '17 at 8:03











  • du -sb --apparent-size filename returns exactly the same number as Windows's Properties Dialog's "Size (... bytes)".
    – Josiah Yoder
    Sep 5 at 15:34










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398033%2fhow-to-see-determine-on-disk-file-size-on-linux%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










I think what you are looking for is du. Executing du -s <directory> shows you much disk space a directory's contents use up. du can also count the sizes of each file in the directory individually and tell you how big their total content is:



du -s --apparent-size <directory>



If you want to know the amount of "wasted" space resulting from allocation in blocks, just subtract the second command's result from the first's.



Note: --apparent-size reports the size in kilobytes. You can use the -b flag instead, if you want to know the exact number of bytes a file contains. This is useful if you want to know how many bytes (without headers and such) you would need to send over the network to deliver the file, for example.






share|improve this answer




















  • Thank you. du is what I was looking for. The combo. du -sh <directory> for space on disk du -b <directory> for actual size
    – user3130012
    Oct 15 '17 at 8:03











  • du -sb --apparent-size filename returns exactly the same number as Windows's Properties Dialog's "Size (... bytes)".
    – Josiah Yoder
    Sep 5 at 15:34














up vote
2
down vote



accepted










I think what you are looking for is du. Executing du -s <directory> shows you much disk space a directory's contents use up. du can also count the sizes of each file in the directory individually and tell you how big their total content is:



du -s --apparent-size <directory>



If you want to know the amount of "wasted" space resulting from allocation in blocks, just subtract the second command's result from the first's.



Note: --apparent-size reports the size in kilobytes. You can use the -b flag instead, if you want to know the exact number of bytes a file contains. This is useful if you want to know how many bytes (without headers and such) you would need to send over the network to deliver the file, for example.






share|improve this answer




















  • Thank you. du is what I was looking for. The combo. du -sh <directory> for space on disk du -b <directory> for actual size
    – user3130012
    Oct 15 '17 at 8:03











  • du -sb --apparent-size filename returns exactly the same number as Windows's Properties Dialog's "Size (... bytes)".
    – Josiah Yoder
    Sep 5 at 15:34












up vote
2
down vote



accepted







up vote
2
down vote



accepted






I think what you are looking for is du. Executing du -s <directory> shows you much disk space a directory's contents use up. du can also count the sizes of each file in the directory individually and tell you how big their total content is:



du -s --apparent-size <directory>



If you want to know the amount of "wasted" space resulting from allocation in blocks, just subtract the second command's result from the first's.



Note: --apparent-size reports the size in kilobytes. You can use the -b flag instead, if you want to know the exact number of bytes a file contains. This is useful if you want to know how many bytes (without headers and such) you would need to send over the network to deliver the file, for example.






share|improve this answer












I think what you are looking for is du. Executing du -s <directory> shows you much disk space a directory's contents use up. du can also count the sizes of each file in the directory individually and tell you how big their total content is:



du -s --apparent-size <directory>



If you want to know the amount of "wasted" space resulting from allocation in blocks, just subtract the second command's result from the first's.



Note: --apparent-size reports the size in kilobytes. You can use the -b flag instead, if you want to know the exact number of bytes a file contains. This is useful if you want to know how many bytes (without headers and such) you would need to send over the network to deliver the file, for example.







share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 14 '17 at 0:56









PawkyPenguin

696110




696110











  • Thank you. du is what I was looking for. The combo. du -sh <directory> for space on disk du -b <directory> for actual size
    – user3130012
    Oct 15 '17 at 8:03











  • du -sb --apparent-size filename returns exactly the same number as Windows's Properties Dialog's "Size (... bytes)".
    – Josiah Yoder
    Sep 5 at 15:34
















  • Thank you. du is what I was looking for. The combo. du -sh <directory> for space on disk du -b <directory> for actual size
    – user3130012
    Oct 15 '17 at 8:03











  • du -sb --apparent-size filename returns exactly the same number as Windows's Properties Dialog's "Size (... bytes)".
    – Josiah Yoder
    Sep 5 at 15:34















Thank you. du is what I was looking for. The combo. du -sh <directory> for space on disk du -b <directory> for actual size
– user3130012
Oct 15 '17 at 8:03





Thank you. du is what I was looking for. The combo. du -sh <directory> for space on disk du -b <directory> for actual size
– user3130012
Oct 15 '17 at 8:03













du -sb --apparent-size filename returns exactly the same number as Windows's Properties Dialog's "Size (... bytes)".
– Josiah Yoder
Sep 5 at 15:34




du -sb --apparent-size filename returns exactly the same number as Windows's Properties Dialog's "Size (... bytes)".
– Josiah Yoder
Sep 5 at 15:34

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398033%2fhow-to-see-determine-on-disk-file-size-on-linux%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay