Question: I have hard drive filled with zeroes.
How to check if all bits on hard drive are zeros using bash?
Answer: od will replace runs of the same thing with *, so you can easily use it to scan for nonzero bytes:
$ sudo od /dev/disk2 | head0000000 ?000000 ?000000 ?000000 ?000000 ?000000 ?000000 ?000000 ?000000*234250000
You can combine this with either dd or pv to get a progress display while the scan is taking place:
$ sudo dd if=/dev/disk2 bs=1M status=progress | od | head# or:$ sudo pv /dev/disk2 | od | head