4

I am using minkube as docker engine. So I can get the many container instances related minikube containers with 'docker ps' command. I want to see the containers without them.

minikube containers's name start with 'k8s-bra-bra' so I want to filter using that.

docker ps command support --filter options but I don't know how to set NOT condition like docker ps --filter "name!=k8s*". please help. thanks.

rura6502
  • 365
  • 2
  • 15
  • 1
    After going though the documentation i could find that docker ps will be able to only support type=value. But you could use grep -v flag to achieve this – sidharth vijayakumar Aug 24 '22 at 06:46

1 Answers1

5

I took a look at the Docker documentation and there doesn't seem to be a default way of setting a NOT condition like that.
However, you can use the grep command to do the filtering:

docker ps | grep -v "k8s"

The -v option tells grep to exclude all the matching patterns.

Nicholas Obert
  • 1,235
  • 1
  • 13
  • 29