You can have dd show the progress of a write by specifying “status=progress” in the command line arguments.
sudo dd if=Downloads/CentOS-8-x86_64-1905-boot.iso of=/dev/sdb status=progress
bob@localhost:~$ sudo dd if=Downloads/CentOS-8-x86_64-1905-boot.iso of=/dev/sdb status=progress
559690240 bytes (560 MB, 534 MiB) copied, 96 s, 5.8 MB/s <-- This is shown while writing.
1093632+0 records in
1093632+0 records out
559939584 bytes (560 MB, 534 MiB) copied, 96.0339 s, 5.8 MB/s
The following commands are dangerous! Proceed with caution!
Change /dev/sdX to your drive. Make sure you get the correct drive, or you could wipe you main system.
dd if=/dev/zero of=/dev/sdX bs=1M status=progress
The status=progress part shows how much dd has writen. Helpful to gauge how far along it is.
If you want a more secure way to erase the drive, change zero to random. Makes it slower, but should be more secure.
dd if=/dev/random of=/dev/sdX bs=1M status=progres
Side note, these commands should work in macOS, but you may need to drop the status=progress option.
The following command works on both OS X and Linux. It creates an image from the SD card called raspi.img which you can later use to clone to another SD Card or just keep as a backup. It is exceptionally useful for backing up a Raspberry Pi.
Replace “mmcblk0” with your SD cards name. Take a look at this post if you need help finding the name.
sudo dd if=/dev/mmcblk0 of=~/raspi.img