I did not find the command in Brew of Yosemite 10.10.3. I am reading the command developed from here:

pv -s $(blockdev –getsize64 /Users/masi/Dropbox/1/r3.raw)

I think blockdev is Linux specific command at the moment and not existing directly in OSX.

How can you install Blockdev in OSX?

1 Answer 1


If you want to get the size of a mounted block device (which is what blockdev -getsize64 does), you can use the following:

diskutil information <device> | grep "Total Size" | sed -e 's/[^(]*(([^Bytes)]*\).*/\1/'

If you want to do the same for a file, you can use the following (amongst many others):

stat -f '%z' <filename>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .