Skip to main content
21 events
when toggle format what by license comment
Jul 13, 2022 at 10:44 comment added Behrooz @ericek111 And that's a macOS problem. It was only removed because they didn't want to support other block sizes. and filesystem compression and deduplication were not even considered. "The -b option was added to an early proposal to provide a resolution to the situation where System V and BSD systems give figures for file sizes in blocks, which is an implementation-defined concept. (In common usage, the block size is 512 bytes for System V and 1024 bytes for BSD systems.) However, -b was later deleted, since the default was eventually decided as 512-byte units."
Nov 24, 2021 at 10:22 comment added ericek111 The -b switch is not in POSIX. macOS doesn't understand it.
S Nov 4, 2021 at 15:28 history suggested ajay4q CC BY-SA 4.0
corrected a convention misunderstanding.
Nov 4, 2021 at 5:04 review Suggested edits
S Nov 4, 2021 at 15:28
Oct 25, 2019 at 6:03 review Suggested edits
Oct 25, 2019 at 7:37
Nov 9, 2018 at 13:31 comment added Arnauld VM ! -a means --all. Consider rather using --apparent-size
S Mar 1, 2018 at 2:04 history suggested CommunityBot CC BY-SA 3.0
Incorporate comments mentioning -c, and resolve comment about du giving disk usage instead of file sizes.
Feb 28, 2018 at 23:34 review Suggested edits
S Mar 1, 2018 at 2:04
May 20, 2016 at 10:07 comment added hamidfzm This command works only with short list of files. See what happens when you have 850000 files in a directory!!!
Jan 22, 2016 at 14:46 comment added Sergiy Kolodyazhnyy This is the correct answer. ls will show size of directory as file, not the total amount of files in that directory. du is recursive, thus allows showing total size of everything inside a directory
Jan 15, 2016 at 17:10 comment added lmat - Reinstate Monica du -h doesn't sum the sizes of the files passed to it. du -h *.so shows the size of each file, but not the sum. I think what you're wanting here is du -hc *.so (or even du -hc *.so | tail -1). But of course, he wants the directory listing, too.
S Dec 15, 2015 at 15:24 history edited Jeff Schaller CC BY-SA 3.0
Helps clarify the exact command, and shows that path is optional
S Dec 15, 2015 at 15:24 history suggested jasonleonhard CC BY-SA 3.0
Helps clarify the exact command, and shows that path is optional
Dec 15, 2015 at 14:58 review Suggested edits
S Dec 15, 2015 at 15:24
Feb 12, 2015 at 17:59 comment added MattDMo The reason I haven't chosen this as the answer (although du is a very useful command) is because I want to maintain the basic functionality of ls -l - listing the contents of a directory, only recursively if I ask, and showing the size of each file, which du does not do. Thank you for the answer, though!
Feb 9, 2015 at 10:41 comment added Stéphane Chazelas Note that du gives the disk usage, not the sum of file sizes.
May 21, 2014 at 16:28 comment added MikeB Yes, du works fine. You can use the -c option (same as --total) to get a total at the end of the list.
Aug 30, 2013 at 15:36 comment added vfclists Does du work with file filters like *.exe, *.jpg etcetera
Apr 18, 2013 at 23:24 review First posts
Apr 18, 2013 at 23:25
Apr 18, 2013 at 23:17 history edited Michael Mrozek CC BY-SA 3.0
added 10 characters in body
Apr 18, 2013 at 23:07 history answered Pete Cornell CC BY-SA 3.0