[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - Convert output of byte count to GB count?



You could use GNU units. It appears to treat SI prefixes as strictly base 10,
so use the KiB/MiB etc. variants where applicable:

> $ units 8112116KiB MiB
>	* 7921.9883
>	/ 0.00012623094

Something like

> …2>&1| awk '/transferred/' {print $1}'|while read i; do units "${i}bytes" "GiB"; done

That will need playing around with.


Reply to: