Shreds free space by overwriting it with random data to prevent recovery of sensitive information
Does a single overwrite (not very secure), specify 7 passes for DoD secure standard
WARNING: you should only do this on old HDD, not SSD, hard drives which have a limited number of writes - you may shorten an SSD's lifespan if you over use this
Use this only if you've accidentally written some credential / sensitive data to disk and then already deleted it, leaving the file data on disk
without a filename to inode pointer to overwrite just the file
This prevents file recovery tools from stealing your sensitive data, credentials etc. because otherwise
the file data is still there on disk without a filename inode pointer and file recovery tools may be able to recover and steal it
Your disk should also be encrypted anyway for security best practices, in which case you shouldn't need to do this
Works by writing random data into a large file in the \$PWD until the disk is full and then deletes the file. This is an old trick from the 2000s
See also:
On Mac:
rm -P overwrites file 3times before deleting it (-P switch is available on BSD 'rm' variant only)
on Linux:
srm from secure-delete package
shred
wipe
sfill works similar to this script except does 2 overwrites - DoD secure standard is 7 overwrites