How to show a progress bar for dd

Hello everyone. I'm back with yet another question. I want to run a script "echo "dd if=$output of=$answer bs=$mymenu status=progress" >> $save
"
but i need to show the progress I can run it as a plain script command but I'd like to know if there's any way of displaying a progress bar.,

AFAIK, GNU dd does not implement "progress bar" (other implementations exist), but only a terse progress information in a text form. I'd use pv in a pipeline, only though for smaller files, as it can significantly decrease the transfer rate, e.g. (this is for testing/presentation purposes only)

dd if=/dev/zero bs=1M count=1000 status=none | pv -s 1000M -p | dd of=/dev/null status=none
[============================================>                            ] 63%

You may also use pv INSTEAD of dd (which is faster than pipelines), read man pv for more details (this is for testing/presentation purposes only)

pv -S -s 25000M -p /dev/zero > /dev/null
[=======================================>                                 ] 56%
2 Likes

In the Linux world there is a command called 'progress' that can do what you require on the core[-]utils, of which 'dd' is one...
I have never used it but you should be able to DL it from your relevant repository if you haven't got it in your system's ${PATH} and then read the 'man' page.
Hope this helps...

2 Likes

Hi @theyikes

Does the version of dd you are using have status=progress ?

If so, this option will work but display plain numerical progress, not a graphical bar.

echo "dd if=$output of=$answer bs=$mymenu status=progress" >> $save

Alteratively, you can use pv (pipe viewer) can provide a graphical progress bar. You can use it to monitor data flow and pipe it into dd.

Here’s an example, FYI only:

echo "pv $output | dd of=$answer bs=$mymenu status=none" >> $save
1 Like