Ubuntu 20.04: connect to wifi command line. On Raspberry Pi Ubuntu, connect to wifi command line. Here is how to connect to wifi using terminal in Ubunu Linux:
To begin with, identify the name of your wireless network interface. To do so execute the following command:
$ ls /sys/class/net
You can also know the name of our network interface using the iwconfig command:
$ iwconfig
You will see that the wireless network interface name would be something like: wlan0 or wlp3s0 or something like this. Once you get the interface name, you will need to activate it if it’s not already activated. To activate, run the ifconfig command:
$ sudo ifconfig wlp3s0 up $ sudo iwlist wlp3s0 s | grep 'Cell\|Quality\|ESSID\|IEEE'
Now to connect to Ubuntu wifi using command line, edit the Netplan configuration file using the following command and insert the following configuration stanza while replacing the SSID-NAME-HERE and PASSWORD-HERE with your SSID network name and password (see below):
$ sudoedit /etc/netplan/50-cloud-init.yaml
The configuration should look like this:
wifis: wlan0: optional: true access-points: "SSID-NAME-HERE": password: "PASSWORD-HERE" dhcp4: true
Now execute the following command to apply the changes and connect to your wifi.
$ sudo netplan --debug apply