This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "File deletion" – news ·newspapers ·books ·scholar ·JSTOR(February 2024) (Learn how and when to remove this message) |

File deletion is the removal of afile from a computer'sfile system.
All operating systems include commands for deleting files (rm onUnix andLinux,[1]era inCP/M andDR-DOS,del/erase inMS-DOS/PC DOS, DR-DOS,Microsoft Windows etc.).File managers also provide a convenient way of deleting files. Files may be deleted one-by-one, or a whole blacklist directory tree may be deleted.
Examples of reasons for deleting files are:
A common problem with deleting files is the accidental removal of information that later proves to be important. A common method to prevent this is toback up files regularly. Erroneously deleted files may then be found in archives.
Another technique often used is not to delete files instantly, but to move them to atemporary directory whose contents can then be deleted at will. This is how the "recycle bin" or "trash can" works.Microsoft Windows and Apple'smacOS, as well as some Linux distributions, all employ this strategy.
InMS-DOS, one can use theundelete command. In MS-DOS the "deleted" files are not really deleted, but only marked as deleted—so they could be undeleted during some time, until the disk blocks they used are eventually taken up by other files. This is how data recovery programs work, by scanning for files that have been marked as deleted. As the space is freed up per byte, rather than per file, this can sometimes cause data to be recovered incompletely.Defragging a drive may prevent undeletion, as the blocks used by deleted file might be overwritten since they are marked as "empty".
Another precautionary measure is to mark important files asread-only. Manyoperating systems will warn the user trying to delete such files. Wherefile-system permissions exist, users who lack the necessary permissions are only able to delete their own files, preventing the erasure of other people's work or critical system files.
The common problem with sensitive data is that deleted files are not really erased and so may be recovered by interested parties. Mostfile systems only remove the link to data. But even overwriting parts of the disk with something else or formatting it may not guarantee that the sensitive data is completely unrecoverable. Special software is available that overwrites data, and modern (post-2001) ATA drives include a secure erase command in firmware. However, high-security applications and high-security enterprises can sometimes require that a disk drive be physically destroyed to ensure data is not recoverable, as microscopic changes in head alignment and other effects can mean even such measures are not guaranteed. When the data is encrypted only the encryption key has to be unavailable.Crypto-shredding is the practice of 'deleting' data by (only) deleting or overwriting the encryption keys.