osx的du以字节计算

Posted timxgb

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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.

以上是关于osx的du以字节计算的主要内容,如果未能解决你的问题,请参考以下文章