From 9a6dcbf895f9da01768e64b73cec88c16157d91e Mon Sep 17 00:00:00 2001
From: Michael Biebl
Typical uses include:
Scripts: Utilize NetworkManager via nmcli instead of @@ -63,47 +65,11 @@
-t | --terse
Output is terse. This mode is designed and suitable for computer (script) - processing.
-p | --pretty
Output is pretty. This causes nmcli to produce easily - readable outputs for humans, i.e. values are aligned, headers are printed, - etc.
-m | --mode { tabular | multiline }
Switch between tabular and multiline output:
-tabular |
-Output is a table where each line describes a single entry. - Columns define particular properties of the entry. |
-
multiline |
-Each entry comprises multiple lines, each property on its - own line. The values are prefixed with the property name. |
-
If omitted, default is tabular for most commands.
- For the commands producing more structured information, that cannot be
- displayed on a single line, default is multiline.
- Currently, they are:
nmcli connection show ID
nmcli device show
-a | --ask
When using this option nmcli will stop and ask for any + missing required arguments, so do not use this option for non-interactive + purposes like scripts. This option controls, for example, whether you will be + prompted for a password if it is required for connecting to a network.
-c | --colors { yes | no | auto }
--complete-args
Instead of conducting the desired action, nmcli + will list possible completions for the last argument. This is useful to implement + argument completion in shell.
+The exit status will indicate success + or return a code 65 to indicate the last argument is a file name.
+NetworkManager ships with command completion support for GNU Bash.
+ -e | --escape { yes | no }
Whether to escape : and \ characters in terse tabular mode. The
+ escape character is \.
If omitted, default is yes.
-f | --fields { field1,field2... | all | common }
This option is used to specify what fields (column names) should be @@ -143,19 +128,46 @@
-e | --escape { yes | no }
-h | --help
Print help information.
-m | --mode { tabular | multiline }
Whether to escape : and \ characters in terse tabular mode. The
- escape character is \.
If omitted, default is yes.
Switch between tabular and multiline output:
+tabular |
+Output is a table where each line describes a single entry. + Columns define particular properties of the entry. |
+
multiline |
+Each entry comprises multiple lines, each property on its + own line. The values are prefixed with the property name. |
+
If omitted, default is tabular for most commands.
+ For the commands producing more structured information, that cannot be
+ displayed on a single line, default is multiline.
+ Currently, they are:
nmcli connection show ID
nmcli device show
-a | --ask
When using this option nmcli will stop and ask for any - missing required arguments, so do not use this option for non-interactive - purposes like scripts. This option controls, for example, whether you will be - prompted for a password if it is required for connecting to a network.
-p | --pretty
Output is pretty. This causes nmcli to produce easily + readable outputs for humans, i.e. values are aligned, headers are printed, + etc.
-s | --show-secrets
-t | --terse
Output is terse. This mode is designed and suitable for computer (script) + processing.
-v | --version
Show nmcli version.
-w | --wait
seconds
--complete-args
Instead of conducting the desired action, nmcli - will list possible completions for the last argument. This is useful to implement - argument completion in shell.
-The exit status will indicate success - or return a code 65 to indicate the last argument is a file name.
-NetworkManager ships with command completion support for GNU Bash.
- -v | --version
Show nmcli version.
-h | --help
Print help information.
Be aware that this command deactivates the specified active connection, but the device on which the connection was active, is still ready to connect and will perform auto-activation by looking for a suitable connection that has - the 'autoconnect' flag set. This includes the just deactivated connection. So - if the connection is set to auto-connect, it will be automatically started on - the disconnected device again.
+ the 'autoconnect' flag set. Note that the deactivating connection profile is + internally blocked from autoconnecting again. Hence it will not autoconnect + until reboot or until the user performs an action that unblocks autoconnect, + like modifying the profile or explicitly activating it.In most cases you may want to use device disconnect command instead.
The connection is identified by its name, UUID or D-Bus path. If @@ -1024,14 +1027,13 @@
Connect to a Wi-Fi network specified by SSID or BSSID. The command
- creates a new connection and then activates it on a device. This is a
- command-line counterpart of clicking an SSID in a GUI client. The command
- always creates a new connection and thus it is mainly useful for connecting to
- new Wi-Fi networks. If a connection for the network already exists, it is
- better to bring up (activate) the existing connection as follows:
+ finds a matching connection or creates one and then activates it on a device.
+ This is a command-line counterpart of clicking an SSID in a GUI client. If
+ a connection for the network already exists, it is possible to bring up
+ (activate) the existing profile as follows:
nmcli con up id name. Note that
- only open, WEP and WPA-PSK networks are supported at the moment. It is also
- supposed that IP configuration is obtained via DHCP.
If --wait option is not specified, the default timeout will be 90
seconds.
Available options are:
@@ -2386,8 +2388,8 @@ It's equivalent to the+bond.options 'option=value'
shows details for "My default em1" connection profile.
nmcli --show-secrets connection show "My Home WiFi"
shows details for "My Home WiFi" connection profile with all passwords. +
nmcli --show-secrets connection show "My Home Wi-Fi"
shows details for "My Home Wi-Fi" connection profile with all passwords.
Without --show-secrets option, secrets would not be
displayed.