nmcli (NetworkManager Command Line Interface) is a command-line tool for controlling NetworkManager, a network management software for Linux. The device subcommand is used for managing hardware devices, including wired and wireless network interfaces, that are managed by NetworkManager. This subcommand can be used to list, show details of, activate, deactivate, and configure network devices.
The nmcli d shorthand can be used instead of nmcli device for convenience.
nmcli device Command Examples
1. Print the statuses of all network interfaces:
# nmcli device status
2. Print the available Wi-Fi access points:
# nmcli device wifi
3. Connect to the Wi-Fi network with a specified name and password:
# nmcli device wifi connect {{ssid}} password {{password}}
4. Print password and QR code for the current Wi-Fi network:
# nmcli device wifi show-password