Skip to content

Instantly share code, notes, and snippets.

@david-sanabria
Created November 29, 2016 20:43
Show Gist options
  • Save david-sanabria/44ae55b2582ecf98cecdf3301f82f5df to your computer and use it in GitHub Desktop.
Save david-sanabria/44ae55b2582ecf98cecdf3301f82f5df to your computer and use it in GitHub Desktop.
How to: Get Currently Connected SSID from the command line
# get-ssid.sh
# To use these commands, identify the snippet that applies to your OS.
# This script currently does not check the OS version, so if you run this command you will
# get unexpected results.
#
##
## MacOS 10.10+
##
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport \
-I | awk '/ SSID/ {print substr($0, index($0, $2))}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment