Just Jeff

macOS using Terminal to toggle WiFi on and off

These commands are enclosed in shell functions but can be run on their own.

wifi_on() {
networksetup -setairportpower en0 on
}
wifi_off() {
networksetup -setairportpower en0 off
}

#bash #cli tools #how-to #macos #scripting #shell scripting #tech tips #tutorial #unix