Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to view passwords in Terminal? Maybe by accessing the Keychain data or something? I want to be able to view passwords in Terminal with just a series of commands.

share|improve this question
up vote 10 down vote accepted

Check out the security command. You can get detailed information about its use by reading its man entry man security

An in-depth article on the securitycommand is here.

share|improve this answer

Suppose we are talking about an internet password of a site. Then you would input:

security find-internet-password -gs

On the other hand if we are talking about a generic password, we use the command

security find-generic-password -gs


-g: is used to display the password for the item found

-a account_name: matches the account name given

-s server: matches teh server string


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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