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

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



Hello,

Bob Proulx a écrit :
> Kent West wrote:
>> The GNU dd command, when sent the -USR1 signal, pauses processing long
>> enough to spit out a status line, like so:
>>
>> 18335302+0 records in18335302+0 records out 9387674624 bytes (9.4 GB)
>> copied, 34.6279 seconds, 271 MB/s
>> ...
>> 5605687296 bytes transferred in 1890.826832 secs (2964675 bytes/sec)
>> ...
>> Is there any thing I can throw at this command, perhaps a sed or awk
>> command, etc, which would convert the status' bytes output to GB output?
[...]
>   $ perl -le 'print 5605687296 / (1024*1024*1024)'
>   5.220703125

Note that 1 GB (gigabyte) is 10^9 bytes as can be seen in the GNU dd
output. 1024^3 is 1 GiB (gibibyte).


Reply to: