LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

nmcli

command-line client for NetworkManager

TLDR

List all NetworkManager connections
$ nmcli connection
copy
Show device status
$ nmcli device
copy
Connect to a Wi-Fi network
$ nmcli device wifi connect ssid --ask
copy
Show available Wi-Fi networks
$ nmcli device wifi
copy
Show password for current Wi-Fi
$ nmcli device wifi show-password
copy
Activate a connection
$ nmcli connection up connection_name
copy
Deactivate a connection
$ nmcli connection down connection_name
copy

SYNOPSIS

nmcli [OPTIONS] {general|networking|radio|connection|device|agent|monitor} [COMMAND] [ARGUMENTS]

DESCRIPTION

nmcli is a command-line client for NetworkManager. It allows controlling NetworkManager and reporting network status, creating, editing, activating, and deactivating network connections, and managing network devices.

PARAMETERS

-t, --terse

Produce terse output suitable for scripts
-p, --pretty
Produce human-readable formatted output
-m, --mode tabular|multiline
Switch between output modes
-c, --colors auto|yes|no
Control colored output
-f, --fields
Specify which fields/columns to output
-e, --escape yes|no
Escape column separators in values
-a, --ask
Prompt for missing parameters
-s, --show-secrets
Display passwords and secrets
-w, --wait seconds
Set timeout for operations
--offline
Work without NetworkManager daemon

OBJECTS

general

Manage NetworkManager status, hostname, permissions, and logging
networking
Control overall networking state and connectivity
radio
Manage Wi-Fi and WWAN radio switches
connection
Manage network connection profiles
device
Manage network interfaces
agent
Run as a NetworkManager secret or polkit agent
monitor
Observe NetworkManager activity in real-time

COMMON CONNECTION COMMANDS

nmcli connection show: List all connectionsnmcli connection up: Activate a connectionnmcli connection down: Deactivate a connectionnmcli connection add: Create a new connectionnmcli connection modify: Change connection settingsnmcli connection delete: Remove a connectionnmcli connection import: Import a VPN connection

CAVEATS

The --ask flag prompts for passwords interactively. Use --show-secrets carefully as it displays sensitive information. The -t option with -f is useful for scripting.

HISTORY

nmcli is the command-line interface for NetworkManager, first released around 2004. It provides a way to manage network connections on systems without graphical interfaces or for automation.

SEE ALSO

Copied to clipboard
Kai