How to delete directory in container from the docker host

Maybe a stupid question, but I cannot figure out how to delete a directory in a container from the docker host.

I tried the instruction

sudo docker rm -R <container_ID>:/Backup

to remove the directory “Backup”, but that does not work: -R not recognised.

Any help is appreciated

Use docker exec | Docker Documentation while the container is running.

Hi meyay,
Thx for quick response. I looked at the docker exec options, but cannot find the right instruction for removing a directory. How to use the exec options for this?

docker exec, is a command for running a command in a container.

So in your case it would be:

docker exec -ti CONTAINER-ID rm -r /backup

thx Martin , that works :grinning: