yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理

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.

posted on 2019-01-26 19:03  xxxxxxxx1x2xxxxxxx  阅读(202)  评论(0编辑  收藏  举报