Background
I can use Finder to view the physical size (bytes) and logical size (on disk). This works for
files, folders (contents), but not volumes:
Alternatively
I can use mdls
to get the same metadata information, but that only works for files:
$ mdls Screen\ Shot\ 2018-01-25\ at\ 16.21.06.png
_kMDItemDisplayNameWithExtensions = "Screen Shot 2018-01-25 at 16.21.06.png"
kMDItemAlternateNames = (
"Screen Shot 2018-01-25 at 16.21.06.png"
)
...
kMDItemLogicalSize = 54319
kMDItemOrientation = 1
kMDItemPhysicalSize = 57344
...
kMDItemUseCount = 1
kMDItemUsedDates = (
"2018-01-25 00:00:00 +0000"
)
Bad luck
I've tried df
and du
but neither display both physical & logical sizes.
Finally, the question!
Is there a command line method to output the physical and logical file size of a folder (contents) and/or a volume (contents)?