Command line to configure WI-FI on Ubuntu

Find card name
cat /proc/net/dev

Scan for WiFi

sudo iwlist scan | more

Change IP configuration

sudo nano /etc/network/interfaces

IP settings

auto wlp12s0
iface wlp12s0 inet static
address 192.168.2.199
netmask 255.255.255.0
gateway 192.168.2.1
wpa-ssid AccessPointName
wpa-psk password
dns-nameservers 8.8.8.8 192.168.2.1

Restart network

sudo ifdown wlp12s0 && sudo ifup -v wlp12s0