osx的du以字节计算

https://stackoverflow.com/questions/5794437/difference-in-size-shown-by-du-command-and-get-info-on-mac-os-x

https://superuser.com/questions/520338/only-get-the-size-from-du-command-not-the-folder-names

https://stackoverflow.com/questions/18689592/how-to-get-file-size-in-bytes-from-shell-script

https://unix.stackexchange.com/questions/19882/directory-size-calculation-difference

Unix equivalent of `du -sb` to get summarized size in bytes

On Linux using GNU du to calculate the size of directory recursively in bytes I can run:

du -sb /etc

What is equivalent syntax for BSD du based on the fact that -b parameter is not available?

find $HOME | xargs stat -f%z | awk '{ s+=$1 } END { print s }'

...crawls thru $HOME, gets file sizes in bytes from stat and sums them up using awk.

原文地址:https://www.cnblogs.com/timssd/p/10324651.html