I have this folder in Ubuntu 18.04 that I completely removed.
sudo rm -rf folder_nameIt 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.
41 Answer
I had the same problem using docker and a postgres container (as @schrodigerscatcuriosity mentioned [what a name btw])
The steps I followed:
doker psdocker stop <<container_name>>sudo chmod 777 -R <<folder_to_delete>>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.