Deleting folder completely, but it comes back

I have this folder in Ubuntu 18.04 that I completely removed.

sudo rm -rf folder_name

It has been deleted, but after a while, the folder comes back, but only with the .cache directory in the folder. It takes about 1 minute until the folder comes back with only the .cache folder in the folder that I want to delete.

I change the permission of the both the .cache folder and the folder itself, deleted them, but it keeps coming back. I also deleted everything piece by piece.

There is also in the .cache folder a pgdata folder.

Thanks,

[edit] Yeah so I was able to finally delete it. As someone pointed out, a process was creating that folder in the background. It was a docker container.

4

1 Answer

I had the same problem using docker and a postgres container (as @schrodigerscatcuriosity mentioned [what a name btw])

The steps I followed:

  1. doker ps
  2. docker stop <<container_name>>
  3. sudo chmod 777 -R <<folder_to_delete>>
  4. rm -rf <<folder_to_delete>>

EDIT: Docker was still creating the <<folder_to_delete>> when I ran it. So, I had to remove the docker images/containers/volumes.

(keep in mind that you'll remove all the docker info so you'll have to re-install them again). Additional info

  • docker system prune -a --volumes

I use PyCharm as IDE. I had to remove the <<folder_to_delete>> from recent projects as well.

enter image description here

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like