File deletion is the practice of removing files from a computer's storage device. Some users delete files because they no longer need them or have multiple copies of the data, while others delete files to erase confidential data and to improve security. Although file deletion is usually intentional, problems can occur when someone accidentally erases a file. Each operating system has its own way of deleting files, so one must consider how best to delete a file based on the reason for the deletion. Erased files are often recoverable with third-party tools, which raises additional security concerns.
The reasons for file deletion can include the need to free up disk space, remove files that are infected by viruses, remove outdated versions of programs and remove sensitive data before getting rid of a storage device. Although users usually perform file deletion themselves, the operating system and its programs also delete files in the computer's background. Some examples of this background deletion include a Web browser that is configured to delete its temporary files when the user closes the application and an operating system's swap and page files, which the operating system constantly erases and rewrites.
When one deletes a file or folder from a computer's hard drive, the data does not usually disappear entirely without the use of third-party drive-wiping tools. The operating system usually first moves the file to its trash or recycle bin, which is a folder that contains deleted items for possible recovery. Although this concept is helpful when one accidentally deletes something, it can create a security concern if the user doesn't empty the folder's contents. Datum still doesn't disappear entirely after one empties the folder because of the way computer file systems work. Over time, more files get written over the deleted data, but remnants of the files remain and can often be recovered with computer forensics or data recovery programs.
The best solution for secure file deletion is the use of a secure erase method. The most common method involves overwriting a disk one or more times in zeros and ones, which places random data on the storage device. The more times the disk is overwritten, the more it decreases the chance that someone can recover the data. If deletion of a drive's files is so critical that there must be no chance of recovery, physically destroying the disk using fire or shredding may be the best solution.