Options for secure file removal in the OS X Terminal
While deleting files in OS X simply involves moving them to the trash and emptying it, this routine does not remove the data of these items, but instead only clears the directory entry for them. The content of the items is kept on disk with the system having no way to access it; as a result, there is potential for the content to be scanned and recovered by data recovery tools.
To prevent this from happening, you can use secure-erase features in OS X, one of which is to securely delete the files in the Finder by choosing this option from the Finder menu, or by holding the Command key when right-clicking the Trash icon in the Dock.
That might be convenient when you are at your system, but if you regularly use the Terminal, either locally or via remote log-in, you might only be familiar with the classic "rm" command for removing files. Unfortunately, like the Finder, the default use of this command only removes the file's directory entry, leaving its contents on disk for potential recovery.