Forum Discussion
LucasTurner
May 09, 2025Iron Contributor
How to delete files off a flash drive safely from computer?
I have some important files on a USB flash drive, including data sheets and photos. Before giving away, I want to make sure the files won't be seen by others. Unfortunately, I can recover the deleted...
WarrenBuff
May 09, 2025Iron Contributor
For Mac users, you can use the built-in add command for permanently deleting files from USB flash drive.
First, open the Terminal app and identify the USB flash drive.
diskutil list
Note: In this example, the flash drive is /dev/disk2. Be sure you pick the correct disk or you risk wiping your main drive.
Before writing raw data, unmount all volumes on the device:
diskutil unmountDisk /dev/disk2
To overwrite every block with zeros:
sudo dd if=/dev/zero of=/dev/rdisk2 bs=1m
- /dev/rdisk2 (the “r” raw device) is faster than /dev/disk2.
- bs=1m sets a 1 MiB block size for better throughput.
- No status=progress on macOS’s built‑in dd, but you can press Control‑T in the Terminal window to see I/O stats.
Once it completes (Terminal prompt returns), you’ve done a zero‑fill pass. This is how to delete files off a flash drive on Mac.
By following these steps, you'll have a reliable, fully offline, multi‑pass wipe of your flash drive—leaving no recoverable remnants behind.