Skip to content

Instantly share code, notes, and snippets.

@dongyuwei
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongyuwei/64d25dd52898d1cfcb98 to your computer and use it in GitHub Desktop.
Save dongyuwei/64d25dd52898d1cfcb98 to your computer and use it in GitHub Desktop.
keychain access from shell
security delete-generic-password -a David -s foobar-service-name
security add-generic-password -a David -s foobar-service-name -w my-password
security 2>&1 >/dev/null find-generic-password -ga David -s foobar-service-name
# see http://blog.macromates.com/2006/keychain-access-from-shell/
@dongyuwei
Copy link
Author

@dongyuwei
Copy link
Author

if service name has space use "":

security 2>&1 >/dev/null find-generic-password -ga test -s "test item"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment