docker container rm $(docker container ls -aq)
docker container stop $(docker container ls -aq)
############ removes all containers #########
docker container rm $(docker container ls -aq)
############ removes all images #############
docker image rm $(docker image ls -q)
# remove containers created between now upto 4hrs back
docker container prune --filter "until=4h"
# remove images created between now upto 4hrs back
docker image prune --filter "until=4h"
docker rmi <image_id>
docker rmi -f <image_id>
docker image rm [OPTIONS] IMAGE_ID [IMAGE_ID...]
#[OPTIONS]
--force , -f Force removal of the image
--no-prune Do not delete untagged parents