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
.