Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I'm unable to find info on how to use networksetup or some other tool on OS X that will allow me to disassociate/leave a WiFi network without turning off AirPort or removing the preferred networks list.

When the Mac hasn't joined any networks but WiFi is on, it is precisely in this state, but I need to know how to trigger this on the command line.

share|improve this question

migrated from Feb 9 '12 at 21:04

This question came from our site for professional and enthusiast programmers.

Apple includes a command line utility to change AirPort settings, called airport.

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z

The -z option will disassociate from any network. If you use that command often, you can link it to a directory that's in your PATH, for example /usr/bin.

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/bin/airport

After this, you'll only have to call:

share|improve this answer
Thank you slhck! Worked like a charm! – Мартин Насковски Feb 10 '12 at 11:04

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.