Using the command line to show the physical and logical size of a folder contents? 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 &amp; 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)?
You can use AppleScript to tell Finder to get the ‘size’ or ‘physical size’:

tell application "Finder" to ¬
    get (physical size of folder (POSIX file "/Applications" as alias)) ¬
        / (1000 ^ 3) ¬
        &amp; " GB" as text


This can be ran in command line using osascript:

$ osascript -e 'tell application "Finder" to get (physical size of folder (POSIX file "/Applications" as alias)) / (1000 ^ 3) &amp; " GB" as text'
49.212469248 GB
$ osascript -e 'tell application "Finder" to get (size of folder (POSIX file "/Applications" as alias)) / (1000 ^ 3) &amp; " GB" as text'
55.858548673 GB