5

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.

1
  • 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 Commented Aug 24, 2022 at 6:46

1 Answer 1

7

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.