1
# dd if=/dev/zero of=test.img bs=1M
11+0 records in
10+0 records out
10485760 bytes transferred in 0.652 secs (16074433 bytes/sec)
# 

When I see:

16074433 bytes/sec

I cannot determine, how much is that.

If I put it in a calculator:

# echo '16074433 / 1024 / 1024' | bc
15
#

I can see that it is 15 MByte/sec. Ok.

The Question: How to make the output of dd human-readable by default?

Hessnov
  • 591

1 Answers1

3

OpenBSD tends to avoid cosmetic features like this one. If you really care, you can install GNU coreutils. Beware that system scripts may not be compatible with GNU coreutils (coreutils implements most features of the corresponding OpenBSD utilities, but not all of them, and not always with the same syntax), so I would not recommend putting GNU coreutils on the PATH.

But why would you need that, anyway? dd is not very useful and hard to use correctly. If you want to see how far along a large file copy is, you can use lsof -o on the process. (At least, you can on most Unix variants, I haven't checked whether this works on OpenBSD.) This works on any process, so you can just use cp or cat to do the copy. If you want more control over bandwidth and status output, you can install pv, which has an OpenBSD port.