2

On Ubuntu 20.04 I have a file on my desktop which I want to delete but every time I do so, it reappears on the next restart. It's a calendar file (.ics). I can't remember exactly how I put it on my desktop in the first place. I may have moved it there from a samba share or exported it from Thunderbird or Google calendar. I tried removing it both by clicking on it and hitting Delete and by typing the following in the terminal:

sudo rm [filename]

How can I delete it permanently?

mike83
  • 29
  • 2
    is the file shown in your Home/Desktop folder and can you not delete it from there? Please [edit] your question with your version of ubuntu – graham Sep 11 '21 at 08:48
  • I've tried deleting it from the Desktop, from the Home/Desktop folder and from the terminal but it has showed up again after restarting. – mike83 Sep 11 '21 at 12:13
  • 2
    [edit] your question with the commands given to delete the file from terminal. rm -f [file-name] or sudo rm -f [file-name] should work see this reference – graham Sep 11 '21 at 13:39
  • 7
    It's possible that it's not a problem with how you're deleting it, but some program is re-creating it. Perhaps you should check the date of the file? If it's new every time, then it's being re-created and it might be better to track down which program is doing it first. – Ray Sep 12 '21 at 10:17

1 Answers1

1

In my case it seemed to be the tracker app.

From what I understood from the documentation, the latter is responsible for indexing paths used by other apps such as file managers. My guess is that if you delete some files with the GUIs, you pass through tracker, so if something goes wrong you may end with a broken indexing and the file path remains dandling in the tracker cache.

In my case, the path string of the deleted folder was written inside the $HOME/.cache/tracker/meta.db file (I checked with grep "path/to/folder $HOME/.cache/tracker/meta.db).

I solved doing a reset:

tracker reset --hard

and rebooted.

momi94
  • 21