[donotprint]
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | Yes |
Requirements | Terminal app |
Time | 2m |
Procedure: How to restart Wifi (en0) using the terminal
- Open the terminal.
- Type the following command to shutdown en0 interface:
sudo ifconfig en0 down - Type the following command to bring it back en0 interface:
sudo ifconfig en0 up - Verify that interface is back online again:
ifconfig -u en0
Sample session:
Fig.01: Enable and Disable OSX Wi-Fi
alias restart_en0='sudo ifconfig en0 down && sudo ifconfig en0 up'
To restart simply type:
restart_en0
Say hello to networksetup command
The networksetup is a configuration tool for network settings in OS X.
Use networksetup restart (on and off) Mac OS X networking
Type the following command to turn it off en0:
networksetup -setairportpower en0 off
OR
networksetup -setairportpower "Wi-Fi" off
Type the following command to turn it on en0:
networksetup -setairportpower en0 on
OR
networksetup -setairportpower "Wi-Fi" on
Sample outputs:
Wi-Fi is not a Wi-Fi interface. Turning on the only airport interface found: en0
Both commands have many more options. See the man page by typing the following command:
man ifconfig
man networksetup
🐧 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |