I will use
nmcli to do this task.
First you need to install
network-manager package, and start the Daemon
$ sudo apt install network-manager
Then let’s check the network interface status by below command
$ nmcli dev status
Next step is to check the available Wifi access points.
$ nmcli dev wifi list
If you can not see the SSID you want to use, you can do a re-scan by below
nmcli dev wifi rescan
OK, let’s try to connect to Wifi using below nmcli command
$ sudo nmcli dev wifi connect xibuka-wifi-5G password 'xxxxxxxxxx'
Or you can use
--ask option to input your password interactively and don’t
$ sudo nmcli --ask dev wifi connect xibuka-wifi-5G
Delete the established connections
sudo nmcli con del xibuka-wifi-5G
That’s all! Hope this help you.