Re: dd statistics output
On Tue, Jul 15, 2014 at 03:14:47PM +0200, Christian Groessler wrote:
> the final output of 'dd' is in "SI mode" (or how to call it). It
> uses 10^6 instead of 2^20 for "megabyte".
...
> Is there a switch to display in "traditional" units
Not in dd itself, afaik.
Recent-ish coreutils versions have 'numfmt', which can be used as a filter.
E.g.
> $ dd if=/dev/zero of=/tmp/sdf bs=1M count=4 2>&1 | tail -1
> 4194304 bytes (4.2 MB) copied, 0.00476939 s, 879 MB/s
> $ dd if=/dev/zero of=/tmp/sdf bs=1M count=4 2>&1 |tail -1|numfmt --from=si --to=iec-i
> 4.0Mi bytes (4.2 MB) copied, 0.00476939 s, 879 MB/s
Note that it only converted the first number. fields, you may want to / have
to write some glue.
See http://www.pixelbeat.org/docs/numfmt.html
Reply to: