Mac OSX Terminal – Get Stored Wireless (Wi-Fi) Password

| | | |

Addition to Find & Scan Wireless Networks the additional line will require a password but then display the stored password for the defined router name.

# List all Wi-Fi - Older macOS
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s

# Newer macOS
networksetup -listpreferredwirelessnetworks en0

# Get Stored Password To Wi-Fi
security find-generic-password -ga "Router_Name" | grep "password:"
Originally Posted on January 18, 2017
Last Updated on June 6, 2025
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.