Connect to WiFi network from command line in Linux

How many of you failed to connect to WiFi network in Linux? Did you bumped into issues like the followings in different forums, discussion page, blogs? I am sure everyone did at some point. This post would help you in case you’re stuck with No Internet, No GUI and you’re in the middle of the desert with no water, food or transport. Ok … maybe not that much, but will certainly help you to connect to Internet from Command Line.