How to securely `shred` a file in Mojave/APFS? I just came across this thread about securely deleting files:


  If, by stroke of misfortune, you're on a magnetic medium, have
  journalling disabled and, for some reason, can't encrypt the disk,
  you're options are:

* Use rm -P which overwrites files with 0xff, then 0x00, and then 0xff again



And this contradictory superuser thread. Apparently it's not easy to securely delete files using Apple's older HFS+/Journaled file system.

Without the use of third-party software, is it possible to natively wipe a file in macOS Mojave (or High Sierra) that's using APFS and FileVault encryption? 

I understand macOS makes it difficult with all of its journaling and backup functionalities. But I'm looking for a shred or srm type of solution that's built into macOS already.
The answer Apple implies:

You don't have to worry about that, since each file's data is not stored contiguously in the drive, but spread out across several physical and logical blocks. Removing a file from the file table makes it nearly impossible to read with forensic software/hardware.

Sources: About Apple File System | Apple File System Reference

The answer that may or may not work:

brew install coreutils
shred Secrets.txt


The documentation for shred doesn't explicitly call out APFS, but from what it says, it might be the case that the data is not necessarily overwritten.

If you wish to engage in determining this, there are contacts and other related links here: http://www.gnu.org/software/coreutils/