In Linux systems, you can use nmcli
commands to connect to Wi-Fi networks. nmcli
is NetworkManager's command-line tool for managing network connections.
Here are nmcli
the steps to connect to a Wi-Fi network via commands:
-
Open Terminal: You can use the Ctrl+Alt+T shortcut to open Terminal, or find Terminal through the Applications menu.
-
Scan for available Wi-Fi networks: Run the following command to scan for available Wi-Fi networks:
nmcli device wifi rescan && nmcli device wifi list
The first line of command is to re-scan for available Wi-Fi networks, and the second line of command is to list the scan results. You will see a list of available Wi-Fi networks and their related information, such as SSID (network name), MODE (mode), CHAN (channel), RATE (speed), etc.
-
Connect to a Wi-Fi network: According to the scan result, select the Wi-Fi network you want to connect to, and run the following command to connect to it:
nmcli device wifi connect <SSID> password <password>
will
<SSID>
be replaced by the SSID (name) of the Wi-Fi network you want to connect to, and<password>
replaced by the password for that network.For example, if you want to connect to a Wi-Fi network named "MyWiFi" with a password of "mypassword", the command would be as follows:
nmcli device wifi connect MyWiFi password mypassword
If the connection is successful, the terminal will display information about the connection.
-
Verify Connection: Run the following command to verify the connection was successful:
nmcli connection show
This will display information for all network connections, including connected Wi-Fi networks.
Hope this helps you nmcli
connect to Wi-Fi network in Linux system with commands! If you have any other questions, please feel free to ask.