Terminal erase free space

Discussion in 'macOS Sierra (10.12)' started by Tech198, Feb 11, 2017.

  1. Tech198 macrumors G5

    Mar 21, 2011
    Australia, Perth
    When using [freespace] option in Terminal when using diskutil, is there a way to just wipe x passes over the file u want to be secure erased ? or is it free space only (which would be to all deleted files weather u have only 1 or more) ? (eg drag and drop path as part of the command.
  2. KALLT macrumors 601

    Sep 23, 2008
    diskutil is for disks, not files. You use ‘diskutil secureErase’ to erase and overwrite the disk, whereas you use ‘diskutil secureErase freespace’ to overwrite the currently unused space on the disk. If you want to delete a particular file, then you can only use ‘rm -P <file>’ in macOS Sierra.

    Apple removed the previous ‘srm’ command that securely erases files. If you are using an SSD, you should not be using any of these operations.

    My advice is to use file-system encryption and encrypted disk images.

Share This Page