4 Podman Options, one must know!!!

sonu kushwaha
2 min readFeb 16, 2022
  1. First one is “ — all” option :

Earlier, to remove all container’s or all images is used like

podman rm $(podman ps -aq)  #for removing all the containers
OR
podman rmi $(podman images) #for removing all the images

but , now you can use

podman rm --all      #for removing all the containers
OR
podman rmi --all #for removing all the images

2) Second one is “-l or — latest

Before this option was available ,it was a type of hectic job to copy paste the long autogenerated container id or name, so now what we can do is ,make the use of latest option

podman run -d centos#now if we need to open interative terminal we can simply use "-l or #--lates" command instead of using container id or container namepodman exec -it -l  #this will take the reference of the latest                
#container created ie continer with centos image

3)Third one is “- -replace

there can be situation , when we are creating container with explicitly specifying the name on the container ,but the container with the same name is already present ,which will report into an error , hence in this scenario we can simply use the “- -replace” to over write the previous container with the same name

podman run --replace --name sonu -d nextcloud

4) Fourth one is “- -ignore

there are scenarios when we delete containers or images with name like

podman rm sonu1 sonu2 sonu3

but in the above case is one of the container is absent it will throw an error, so to ignore the error we can simply use “- -ignore” option so to ignore the above scenario discussed.

thank you!!!!!

--

--