Is there any way to do a partial (wildcard) search for a password from my iCloud keychain or Chrome via shell?

E.g., given "foo" I would like to find all keychain items (of any kind, including "Web form password" and "Internet password") where the URL ("Where") or "Name" or "Account" contains "foo".

I have tried security find-internet-password -l 'example.com' and all kinds of variations but everything results in

security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.

Looked at Deleting password from Keychain in terminal and https://apple.stackexchange.com/a/378713/119271 (as suggested by https://apple.stackexchange.com/users/119271/allan) but they did not help.

  • 1
    Neither of those threads answers my question or provides a working solution.
    – Dan
    Feb 7 at 17:46
  • Can you please be more specific about what you tried from the Q&A linked above, and how it didn't work?
    – nohillside
    Feb 7 at 18:20
  • Hi @Dan. Your question is about searching keychain via Terminal. Both Qs above contain information on searching and manipulating keychain via Terminal. If those aren't sufficient, can you provide additional details?
    – Allan
    Feb 7 at 18:25


You must log in to answer this question.

Browse other questions tagged .