If you have upgraded your Mac to OS X El Capitan or newer (Sierra, High Sierra, Mojave, etc), you may have noticed the Secure Empty Trash option is missing. When you are in the recycle bin, the only option that seems to be available is Empty Trash.
This is annoying because it’s nice to have the option to feel like you are completely obliterating a file. Fortunately there is a way to securely delete a file using the command line.
Warning: This process can seriously mess up your computer if misused. Only follow the steps below if you are comfortable with the command line and accept the risks if you mess up!
How to Securely Remove a File from OS X El Capitan
1. Start by finding the file you want to delete in finder.
2. Open a Terminal window (Command + Space, type terminal)
3. Type the srm -v command in the terminal window then drag your file from the finder window to the terminal window to add the path
Hitting enter after typing the full command will show status that says “removing <filename>” then “done”
Your file should now be completely destroyed.
Deleting an Entire Directory
If you want to delete an entire directory full of files, the command is very similar as displayed above. Simply use “-rv” after the command as follows:
srm -rv /filepath/filename
That’s all there is to it. Go forth and delete files securely with confidence!