↧
Answer by mgutt for A standard tool to convert a byte-count into human KiB...
This is what I'm using:echo 10000000 | awk '{split("Byt,KiB,MiB,GiB,TiB", unit, ","); (size=$1) ? level=sprintf("%.0d", (log(size)/log(1024))) : level=0; printf "%.2f %s\n", size/(1024**level),...
View Article