Hi, yes you can use for example:
diskutil list (and find out the /dev/disk#)
diskutil unmoundDisk /dev/disk2
diskutil unmoundDisk /force /dev/disk2 (or with force if needed)
diskutil eraseDisk AFPS MyDiskName /dev/disk2
diskutil eraseDisk FORMAT DRIVE_NAME /dev/disk#
Formatting a Disk to Mac OS Extended Journaled (APFS) from Terminal in Mac OS X
diskutil eraseDisk APFS DiskName /dev/DiskX
Formatting a Disk to Mac OS Extended Journaled (JHFS+) from Terminal in Mac OS X
diskutil eraseDisk JHFS+ DiskName /dev/DiskX
Formatting a Disk to Mac OS Extended (HFS+) from Terminal in Mac OS X
diskutil eraseDisk HFS+ DiskName /dev/DiskX
Formatting a Disk to MS-DOS fat32 from the Command Line in Mac OS X
diskutil eraseDisk FAT32 DiskName /dev/DiskX
Formatting a Disk to ExFAT from the Command Line in Mac OS X
diskutil eraseDisk ExFAT DiskName /dev/DiskX
Again, any of these commands erase the entire target disk and obliterates any data on it.
See more details in this links:
https://easyosx.net/2022/08/29/erase-a-macs-hard-drive-using-the-terminal/
Jefferis Peterson wrote:
I have removed harddrives from an older mac (2004) that I disposed of. I am trying to erase or access the drive which I have in a NewerTech dock. The drive is visible but when I try to Get Info there is a custom setting that cycles in Fetching mode and never completes. I have tried erase and reformat but I am not allowed to do that either. Are there any terminal commands I could use and run permissions on the external, not the internal drives? Been searching online but can't find a tutorial. The drive keeps saying I don't have sufficient permissions to do anything.