Securely Wipe the Free Space on Your Mac Using the Command Line
Before wiping the free space on your Mac using the command line, back up your data.
Once you’ve backed up your data, open the Terminal app from the Applications > Utilities folder.
Then, type the following command at the prompt and press Enter.
diskutil secureErase freespace 4 /Volumes/Macintosh\ HD
Make sure you include “freespace” in the command. This indicates you are only erasing the free space on the drive and not the entire drive.