iwgetid [interface] [--raw] [--scheme] [--ap] [--freq] [--mode] [--protocol] [--channel]
iwgetid is used to find out the NWID, ESSID or AP/Cell Address of the wireless network that is currently used. The information reported is the same as the one shown by iwconfig, but iwgetid is easier to integrate in various scripts. By default, iwgetid will print the ESSID of the device, and if the device doesn't have any ESSID it will print its NWID. The default formatting output is pretty-print.
iwconfig(8), ifconfig(8), iwspy(8), iwpriv(8).