Quantcast
Channel: A standard tool to convert a byte-count into human KiB MiB etc; like du, ls1 - Unix & Linux Stack Exchange
Browsing all 21 articles
Browse latest View live

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

Browsing all 21 articles
Browse latest View live