← 返回命令列表

Linux command

nmcli 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

nmcli connection

Example

nmcli device

Connect

nmcli device wifi connect ssid --ask

Example

nmcli device wifi

Example

nmcli device wifi show-password

Activate

nmcli connection up connection_name

Deactivate

nmcli connection down connection_name

说明

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.

参数

-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

FAQ

What is the nmcli command used for?

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.

How do I run a basic nmcli example?

Run `nmcli connection` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --terse do in nmcli?

Produce terse output suitable for scripts