​​ ​

The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.


You can continue to find trusted guidance and support on the official Apple Support site. 


We want to thank the community members who have contributed their time and expertise to help others with their Apple products.


How can I find Wi-Fi SSID using a terminal command?

How can I find the SSID from the wifi with a cmd in the terminal



[Re-Titled by Moderator]


iMac 24″, macOS 14.6

Posted on Feb 6, 2025 2:14 AM

8 replies

Feb 6, 2025 2:49 AM in response to rinus228

Hello. Have you tried using wdutil?


usage: sudo wdutil diagnose [-q] [-f outputDirectoryPath]

            -q may be specified to suppress legal prompt and Finder window

       sudo wdutil info

       sudo wdutil log [{+|-} {system|wifi}]+

       sudo wdutil dump

       sudo wdutil clean

Feb 6, 2025 5:05 AM in response to kaz-k

kaz-k wrote:

You can see it following commands in the Terminal.app.

networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | xargs networksetup -getairportnetwork

What I get…

dialabrain@iMac-M3 ~ % networksetup -listallhardwareports | awk '/Wi-Fi/{getline; print $2}' | xargs networksetup -getairportnetwork

You are not associated with an AirPort network.

Feb 6, 2025 7:40 AM in response to rinus228

The following works on my Sequoia v15.3 system to output the SSID using the Zsh shell. It gets a sorted list of the en0 - en9 interfaces and performs an ipconfig getsummary on each. Finally, it finds the SSID (that leading space is deliberate) string in the getsummary output and prints it. Failed matches are discarded to dev/null.


for i in ${(o)$(ifconfig -lX "en[0-9]")};do ipconfig getsummary ${i} | awk '/ SSID/ {print $NF}';done 2> /dev/null



The wdutil info output shows <redacted> for both SSID and BSSID on my system. I am using WPA3 security and that may have something to do with the redaction.


A Zsh script that will also work (once made executable) if one's shell is Bash follows:

#!/bin/zsh

for i in ${(o)$(ifconfig -lX "en[0-9]")};
do 
    ipconfig getsummary ${i} | awk '/ SSID/ {print $NF}'
done 2> /dev/null
exit 0


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I find Wi-Fi SSID using a terminal command?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.