nmcli d wifi connect <WiFiSSID> password <WiFiPassword> iface wlan0
原文链接:http://askubuntu.com/questions/461825/connect-to-wifi-from-command-line