How can I connect to a wireless network with hidden SSID using the terminal?

view full story

http://unix.stackexchange.com – I'm starting to learn about wireless pentesting with BackTrack, and while learning how to find out the hidden SSID I wondered how could I connect to the wireless network after I discover the SSID. The book I'm studying does not cover that topic, only how to find the SSID. I tried: ifconfig wlan0 netmask up iwconfig wlan0 essid "XXXX" channel X but that doesn't work. Result in screenshot: (HowTos)