If you run iwconfig 2>&1 | grep ESSID, you will get a result something like this:
iwconfig 2>&1 | grep ESSID
wlan0 IEEE 802.11bgn ESSID:"NETWORK_ID"