1. 连接wifi
    nmcli device[dev] wifi connnect[con] [password ]
┌──(root💀localhost)-[/etc/NetworkManager/system-connections]
└─# nmcli dev wifi connect HEBEU                       
Device 'wlan0' successfully activated with '0a23a56e-1990-4947-84b4-108d8f07c68c'.

  1. wifi的密码等信息将会保存到/etc/NetworkManager/system-connections下:
┌──(root💀localhost)-[/etc/NetworkManager/system-connections]
└─# ls
FLA-AL10.nmconnection  HEBEU.nmconnection
                                                  
  1. 经过了第一次连接成功,以后连接wifi直接使用nmcli dev dis wlan0 就会自动连接已经连接过的wifi了。
    wlan0 为wifi设备名称。
## 断开wifi  
┌──(root💀localhost)-[/etc/NetworkManager/system-connections]
└─# nmcli dev dis wlan0          
Device 'wlan0' successfully disconnected.  
## 连接wifi  
┌──(root💀localhost)-[/etc/NetworkManager/system-connections]
└─# nmcli dev con wlan0
Device 'wlan0' successfully activated with '0a23a56e-1990-4947-84b4-108d8f07c68c'.