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.