Viewing a single comment thread. View all comments

mtheofilos t1_iy3ulgq wrote

TL;DR: Files on the disk use space, not memory, the file still exists but it is no longer accessible and the operating system doesn't count it anymore to calculate free/used disk space.

You may be confused with memory and space. Memory refers to what running programs use, e.g. what Chrome uses right now to display stuff, space refers to the capacity of a drive (HDD, SSD, etc). Computers have a file system, which keeps track of where files are located in the disk and gives the programs of your computer some tools to interact with them. When you delete a file, you basically unlink it from the system. The file is no longer accessible, and if the file system supports a trash bin, it moves the link to the file there, so you can link it back to its original position (e.g. to a path like C:\Users\MyUser\Desktop), the links in the path are basically the "\". Once the file is removed from the trash bin, it is no longer accessible from anywhere like Trash Bin, C:\, D:\, e.t.c. and then depending on the hard disk's type (HDD, SSD) does one of the two things, either marks it as free space and then a new file may overwrite the old one (HDD), and for SSDs it gives it a signal that the area the file is no longer used, so the SDD will manage the used space on its own. So if that area is not touched at all, you can use some programs that will scan the disk and they can "recover" the file if it was permanently deleted. What they do is actually locate the file with some tricks and then create a new link so it can be traced again (C:\...\Desktop\MyRecoveredFile.pdf). To permanently delete a file for good, a program will just write a bunch of zeroes on top of the file and then unlink it from the system, like what you would do with a correction tape or fluid on a piece of paper to "remove" the letters and write something new on top. Now that you learned about links, you may understand that when you move files, you actually don't physically move them you just move the link in the file system, that's why cut/paste files is faster than copy/paste.

2