Nmcli: Difference between revisions
From ICO wiki
Jump to navigationJump to search
No edit summary |
|||
Line 15: | Line 15: | ||
= | =Käsu süntaks= | ||
nmcli [ OPTIONS ] OBJECT { COMMAND | help } | nmcli [ OPTIONS ] OBJECT { COMMAND | help } | ||
Line 32: | Line 33: | ||
==OPTIONS== | ==OPTIONS== | ||
-t, --terse | -t, --terse | ||
Output is terse. This mode is designed and suitable for | Output is terse. This mode is designed and suitable for | ||
computer (script) processing. | computer (script) processing. | ||
-p, --pretty | -p, --pretty | ||
Output is pretty. This causes nmcli to produce easy readable | Output is pretty. This causes nmcli to produce easy readable | ||
outputs for humans, i.e. values are aligned, headers are | outputs for humans, i.e. values are aligned, headers are | ||
Line 41: | Line 46: | ||
-m, --mode tabular | multiline | -m, --mode tabular | multiline | ||
Switch between tabular and multiline output. If omitted, | Switch between tabular and multiline output. If omitted, | ||
default is tabular for most commands. For the commands | default is tabular for most commands. For the commands | ||
Line 53: | Line 60: | ||
-f, --fields <field1,field2,...> | all | common | -f, --fields <field1,field2,...> | all | common | ||
This option is used to specify what fields (column names) should | This option is used to specify what fields (column names) should | ||
be printed. Valid field names differ for specific commands. | be printed. Valid field names differ for specific commands. | ||
Line 65: | Line 74: | ||
-e, --escape yes | no | -e, --escape yes | no | ||
Whether to escape ':' and '\' characters in terse tabular mode. | Whether to escape ':' and '\' characters in terse tabular mode. | ||
The escape character is '\'. If omitted, default is yes. | The escape character is '\'. If omitted, default is yes. | ||
-v, --version | -v, --version | ||
Show nmcli version. | Show nmcli version. | ||
-h, --help | -h, --help | ||
Print help information. | Print help information. |
Revision as of 18:13, 27 November 2012
Sissejuhatus
nmcli on käsurea tööriist, mille abil saab kontrollida NetworkManageri ja pärida selle staatust. See ei ole mõeldud asendamiseks mõnda nm-applet või muid sarnaseid programme. Pigem on see mõeldud täiendavaks nendele programmidele. Peamiselt leiab nmcli kasutatavust serverites, iseseisvale masinale või lihtsalt edasijõudnud kasutajatele, kes eelistavad kasutada käsurida.
Erinevaid kasutusviise
1) Initskriptit: ifup / ifdown saab kasutada nmcli kaudu Network managerile ligi pääsemiseks, selle asemel, et hallata ühendusi ise ja segada NetworkManageri tööd.
2) Servereid, peata masinaid, millel puudub graafiline liides, siis kasutatakse nmcli-d et rääkida otse NetworkManageri ja kontrollida kogu süsteemi ühendusi.
3) Kristian Kivimägi A22
Käsu süntaks
nmcli [ OPTIONS ] OBJECT { COMMAND | help }
OBJECT := { nm | con | dev }
OPTIONS := { -t[erse] -p[retty] -m[mode] tabular | multiline -f[ields] <field1,field2,...> | all | common -e[scape] yes | no -v[ersion] -h[elp] }
OPTIONS
-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 easy readable outputs for humans, i.e. values are aligned, headers are printed, etc.
-m, --mode tabular | multiline
Switch between tabular and multiline output. 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. Currenly, they are: 'nmcli con list id|uuid <name>' 'nmcli dev list' tabular - Output is a table where each line describes a single entry. Columns define particular properties of the entry. multiline - Each entry comprises more lines, each property on its own line. The values are prefixed with the property name.
-f, --fields <field1,field2,...> | all | common
This option is used to specify what fields (column names) should be printed. Valid field names differ for specific commands. List available fields by providing an invalid value to the --fields option. all is used to print all valid field values of the command. common is used to print common field values of the command. If omitted, default is common. The option is mandatory when --terse is used. In this case, generic values all and common cannot be used. (This is to maintain compatibility when new fields are added in the future).
-e, --escape yes | no
Whether to escape ':' and '\' characters in terse tabular mode. The escape character is '\'. If omitted, default is yes.
-v, --version
Show nmcli version.
-h, --help
Print help information.