Is there a terminal command to verify if Wifi is enabled?
Since my laptop doesnt have a Wireless Network LED indicator, I want to know if there is a command to verify if it is on or off (I'm installing the wireless drivers, so I can't tell if it is set on or off by seeing the list of wireless conections next to the clock)
Edit:
nmcli
changed a lot (I am using 16.04) from its previous version. See the original answer below.
To see the connectivity status
$ nmcli general status
STATE CONNECTIVITY WIFI-HW WIFI WWAN-HW WWAN
connected full enabled enabled enabled enabled
To see only wifi status
$ nmcli radio wifi
enabled
To see the active connection
$ nmcli connection show --active
NAME UUID TYPE DEVICE
VolCSe 5u6h4521-7k1p-20r3-3g4x-fg19his0j3s8 802-11-wireless wlp2s0
There are some nice addlitions like, to get the available wifi network informations,
$ nmcli device wifi
* SSID MODE CHAN RATE SIGNAL BARS SECURITY
* VolCSe Infra 1 54 Mbit/s 73 ▂▄▆_ WPA2
Sach Infra 4 54 Mbit/s 55 ▂▄__ WPA1 WPA2
iKCP Infra 5 54 Mbit/s 24 ▂___ WPA2
TP-LINK_POCKET_3 Infra 1 54 Mbit/s 12 ▂___ WPA1 WPA2
Note: I have used fictitious ssid and uuid info above.
Old answer:
You can use nmcli
for this purpose. Open a terminal type in terminal,
nmcli nm
You will have output like,
RUNNING STATE WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN
running connected disabled disabled enabled disabled
See the third and fourth column which contains information of your interest.
If you want to be more specific only to wifi, then try in terminal,
nmcli nm wifi
it will show the wifi status only,
WIFI
disabled
rfkill list
This wil show devices that are either software or hardware blocked. In my case it's not blocked and wifi is on:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
When the driver is up and running, the wireless interface should show up in the list when using the following command:
ifconfig
As of 15.04 (and later, including 16.04 LTS), the nmcli command has changed. There, you'll use:
⟫ nmcli radio
WIFI-HW WIFI WWAN-HW WWAN
enabled enabled enabled enabled
or just
⟫ nmcli radio wifi
enabled