I'm curious how Linux deletes its files in /home partiiton

grigory

Member
Jan 31, 2016
41
0
66
Hello,

I've got Ubuntu 14.04 Desktop and recently I deleted a pretty big file. Its size was 7 GB. It wasn't in a trash bin. The file was physically in my Downloads folder. So I thought that it had disappeared from the system altogether after the deletion. BUT... Couple of things...
a) In GParted I still saw that my /home partition usage was big enough, like I included that big file;
b) When I tried a backup of my /home partition, I saw that file in some mysterious .trash directory.
That all was yesterday. Today after I turned on my computer, the file actually did disappear (Thanks God!) and everything got back to normal. And I couldn't even find that strange .Trash folder anywhere in my /home partition.
 

Scarpozzi

Lifer
Jun 13, 2000
26,391
1,780
126
I'm sort of speaking generally here, so someone else might know specifics.

It depends on how you delete the file. If you delete it from the gui, it's supposed to go to the trash unless you permanently delete it (like using shift + delete). If you know which user's trash it ended up in, you can empty the trash...either for that user or for root depending on which user actually did the deletion. I'm not sure in Ubuntu what disk cleanup utilities run, but typically trash is going to have a % partition limitation thrown on it (like 10% of volume size) that may eventually cleanup the file if it's over the threshold. You may have seen the issue correct itself overnight due to a scheduled system cleanup job.

If you want to get rid of it for good without waiting, you should go to a terminal session and delete it using.

sudo rm -f filename

or bypass trash using shift + delete:
https://www.maketecheasier.com/how-to-bypass-the-trash-and-delete-a-file-completely/