Did you know that on Linux, you can easily check all the Wi-Fi networks that you have previously connected to? You can even view saved Wi-Fi passwords on Linux using nmcli.
What Is nmcli?
The nmcli (short for “NetworkManager Command-Line Interface”) utility is a powerful command-line tool for controlling NetworkManager, a daemon used for managing network settings and connections on Linux.
You can use nmcli for general management of Wi-Fi networks, such as listing and connecting to a Wi-Fi network from your Linux PC. It is also particularly useful in networking scripts or on servers that do not have a GUI.
Installing nmcli on Linux
Most distros have nmcli installed by default, but in case it’s not installed on yours, here’s how to proceed.
To install nmcli on Debian-based distros such as Ubuntu, MX Linux, and Pop!_OS, use the APT package manager:
On RHEL and similar distros such as Alma Linux, Fedora, Rocky Linux, etc., you can use the DNF package manager as follows:
On Arch Linux-based distros, you can install nmcli using Pacman:
Viewing Saved Wi-Fi Networks Using nmcli
To view information on all the Wi-Fi networks you’ve previously connected to on your PC, run the following command:
If you do not filter with grep, nmcli lists all the networks including wired networks, bridged connections, and VPN connections.
The output for the preceding command will look like this:
The Wi-Fi name or SSID (Service Set Identifier) is listed in the first column, followed by the UUID (Universally Unique Identifier), then the network type (Wi-Fi in this case). Finally, the last column shows the device type of the network.
Viewing Saved Wi-Fi Passwords on Linux
You’ll need elevated privileges on Linux to view saved passwords with nmcli.
You can check the password of a known Wi-Fi network using:
…where WiFiName is the name of the Wi-Fi network you’re interested in.
For example, to view the password of a Wi-Fi network named “iPhone,” run the following:
The password for the Wi-Fi network iPhone is listed as “test1234.”
In case you’re wondering where nmcli stores its Wi-Fi configuration files, it’s in the /etc/NetworkManager/system-connections directory.
Improve Your Home Network With Mesh Wi-Fi
nmcli is a great utility for managing network settings and connections on your Linux PC.
If you are having Wi-Fi connection problems in your home or office location, you can purchase a mesh Wi-Fi device for better connectivity.