This method is suitable if you don’t have access to the graphical user interface normally used to set up WiFi on the Raspberry Pi. It’s especially suitable for use with a serial console cable if you don’t have access to a screen or wired Ethernet network. Note also that no additional software is required; everything you need is already included on the Raspberry Pi. GETTING WIFI NETWORK DETAILS To scan for WiFi networks, use the command sudo iwlist wlan0 scan. This will list all available WiFi networks, al
Source: Setting WiFi up via the command line – Raspberry Pi Documentation
Setting WiFi up via the command line – Raspberry Pi Documentation was last modified: July 13th, 2017 by