Update: See comments for a much better (and prettier!) way to do it with pipe viewer. Thanks Bill!
So you’re wiping a drive or writing an image using ‘dd‘ (dataset definition) and you’re not sure where it’s up to. There’s no built in way to check the progress (until it’s finished), so I use kill and pgrep.
On one terminal, run your dd command., something like this:
dd if=/dev/zero of=/dev/sdX bs=4096
On a second terminal, run the following:
kill -USR1 `pgrep ^dd`
Back on terminal one, it should spit out where it’s up to but keep on dd’ing away, like so:
2202+0 records in
2202+0 records out
2308964352 bytes (2.3 GB) copied, 24.3584 s, 94.8 MB/s
This only works with one instance, for multiple instances get the right dd or use a for loop to check them all.