$linuxjunkies
>

nmcli(1)

NetworkManager command-line interface for controlling network connections and devices.

UbuntuDebianFedoraArch

Synopsis

nmcli [OPTIONS] OBJECT { COMMAND | help }

Description

nmcli is a command-line tool for interacting with NetworkManager, the system network service. It allows you to query network status, create/modify/delete network connections, control device activation and deactivation, and manage Wi-Fi networks from the terminal.

Common objects include: general (overall status), device (network interfaces), connection (connection profiles), radio (enable/disable wireless), and agent (authentication handling). Each object supports various commands like show, list, add, delete, modify, and activate.

Common options

FlagWhat it does
-t, --terseOutput terse format; removes column headers and separators
-p, --prettyOutput in pretty-printed format with colors and indentation
-m, --mode tabular|multilineSet output mode; tabular shows data in columns, multiline shows fields vertically
-f, --fields field1,field2,...Specify which fields to display in output
-e, --escape yes|noEscape column values in tabular output
-n, --nocheckDon't check if NetworkManager is running before executing
-a, --askAsk for missing required parameters instead of using defaults
-w, --wait secondsMaximum time to wait for completion of operations
--versionShow program version and exit
-h, --helpShow help message and exit

Examples

Show status of all network devices (Wi-Fi, Ethernet, etc.)

nmcli device status

List all available network connection profiles

nmcli connection show

Activate the 'MyWiFi' connection profile

nmcli connection up MyWiFi

Scan and display available Wi-Fi networks

nmcli device wifi list

Connect to a Wi-Fi network by SSID with password

nmcli device wifi connect 'SSID' password 'mypassword'

Set a static IP address on the MyConnection profile

nmcli connection modify MyConnection ipv4.addresses '192.168.1.100/24'

Disable all Wi-Fi adapters

nmcli radio wifi off

List connection names and types in terse format

nmcli -t -f NAME,TYPE connection show

Related commands