Forum Discussion

jfs's avatar
7 days ago

op item list --tags a,b returns union not intersection

How can I get the intersection of the two tags natively using op?

if not possible what s the easiest way to do it? any tips?

thanks

1 Reply

  • Hi jfs​ ,

    'op' does not support it natively, but you can always use 'grep' twice for a quick filter. I guess it depends on what you are trying to do with the results.

    op item list --tags a,b \
      | grep "a" \
      | grep "b"

    Let me know if this is what you are after or something different.

    Thanks,
    Phil