3 ms·
> I encourage you to search (you can use LLMs) to figure out how to print the SSID you're connected to from the CLI. Yeah, the official Apple support forums ar
by grvbck 9mo ago
> I encourage you to search (you can use LLMs) to figure out how to print the SSID you're connected to from the CLI.
Yeah, the official Apple support forums are and have always been embarrassingly bad.
I don't use the CLI on my Macs all that often, so there might be a better way to do it, but this works on Tahoe:
networksetup -listpreferredwirelessnetworks en0 | grep -v '^Preferred networks on' | head -1 | xargs
There's also get-ssid:
https://github.com/fjh658/get-ssid https://github.com/fjh658/get-ssid
- godelski 9mo ago> networksetup -listpreferredwirelessnetworks en0 On Sequoia this command shows you the history of SSIDs, not the current SSID you're on. For easy verification turn off your WiFi and run the command, you'll get identical output. Is Tahoe doing something different? If so, honestly that only exemplifies my point of how Apple is creating a difficult ecosystem to navigate through, where the correct incantations change, even through minor versions. *IT IS MADDENING* > There's also get-ssid: https://github.com/fjh658/get-ssid I think the README is quite illustrative of the problem here. Seems like John ran into the same issue I was! He even mentions the issue with the `-getairportnetwork` flag for `networksetup`. But get-ssid still has a problem... it requires root. For my original use case I was wanting to run ssh proxy jumps and rsyncs based on the SSID I'm connected to. This doesn't really work for those cases. Escalating to root just creates a major security concern and I definitely don't want automated processes doing escalating unless absolutely necessary.