2

I have checked that deleted files are still in use by the command

sudo find /proc/*/fd -ls | grep '(deleted)'

And I have been able to check for deleted files that are still in use. Why does this occur? Is there any way to delete them permanently?.

  • Empty your trash or use SHIFT+DEL. –  Jan 21 '17 at 23:09
  • 3
    @CelticWarrior When a process has a file open, as revealed by examining entries in `/proc` as the OP has done, that file's contents are not yet eligible for deletion, even if the file has been deleted ([unlinked](https://en.wikipedia.org/wiki/Unlink_(Unix))) in the filesystem. This has nothing to do with the trash. – Eliah Kagan Jan 21 '17 at 23:13
  • @EliahKagan Indeed. I think the OP knows that as well, if not he should. I merely suggested a way to delete permanently. –  Jan 21 '17 at 23:15
  • 3
    @CelticWarrior When you delete a file with Shift+Delete or empty the trash, the file is still not gone if a process has the file open. So your advice is completely irrelevant to this problem. Readers who know this will wonder what you are talking about, and readers who don't will be misinformed. – Eliah Kagan Jan 21 '17 at 23:19

1 Answers1

2

As explained by Eliah Kagan in the comments, if a process has file open, it shall remain in memory even if file is unlinked from the filesystem. The simple approach is to reboot, since /proc is a virtual filesystem and its contents don't remain on the hard drive

Sergiy Kolodyazhnyy
  • 103,293
  • 19
  • 273
  • 492