Deleting a file usually just cuts a thread that points to it
On Unix-like systems, the command to remove a file does not erase any data. It snips one named link to the file; only when every link is gone does the system mark that space as free, and until it is overwritten, recovery tools can often bring it back. Fittingly, the word file comes from the Latin for thread.
A computer file is a named bundle of data that the system treats as one unit. On most modern systems it is simply a row of bytes, and what those bytes mean depends on the content. A name ending such as .txt hints that the bytes are text characters; image, audio and video formats read them quite differently. Most formats also set aside a few bytes of metadata so a file can describe itself. Many files are made of repeating records, like one line per employee in a payroll file, much as paper records once filled a dedicated drawer.
The word travelled from threads used to string papers together, to office filing systems, to computing. In 1940 a book on punched-card methods mentioned tables stored as a file of cards, and a 1950 RCA advertisement boasted that results could be kept on file in its new memory tube. Early on the term could mean the hardware itself: IBM called its 350 disk drives disk files. The modern sense arrived around 1961, when the Burroughs MCP and MIT's time-sharing system introduced file systems that managed many virtual files on a single device.
Today the file system hides the messy details. Programs refer to files by name, while the kernel handles the actual storage. That is why moving a file within one drive is nearly instant: only its path changes, not its data. Moving between drives is different, and tools disagree on timing. Some delete each original as soon as its copy is done, freeing space gradually; others wait until everything has copied, so an interrupted transfer frees nothing and may leave a truncated last file behind.
Truly erasing data needs special secure-deletion programs that overwrite the underlying storage, since leftover free space can be read by recovery software. A computer may also run several file systems at once; Windows, for example, still reads the old FAT format beside its usual NTFS.
Source: Computer file