summaryrefslogtreecommitdiff
path: root/docs/cli.rst
blob: 2861a73cc6e5c056b1ae1cac516341401d74666a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.. _cli:

###
CLI
###

The VyOS :abbr:`CLI (Command-Line Interface)` comprises an
:ref:`commandtree_operationmode` and a :ref:`commandtree_configmode`.

Operational mode allows for commands to perform operational system tasks and
view system and service status, while configuration mode allows for the
modification of system configuration. The :ref:`command tree page<commandtree>`
lists available commands and their functions.

The CLI provides a built-in help system. In the CLI the ``?`` key may be used
to display available commands. The ``TAB`` key can be used to auto-complete
commands and will present the help system upon a conflict or unknown value.

For example typing ``sh`` followed by the ``TAB`` key will complete to
``show``. Pressing ``TAB`` a second time will display the possible
sub-commands of the ``show`` command.

.. code-block:: console

  vyos@vyos:~$ s[tab]
  set   show

Example showing possible show commands:

.. code-block:: console

  vyos@vyos:~$ show [tab]
  Possible completions:
    arp           Show Address Resolution Protocol (ARP) information
    bridge        Show bridging information
    cluster       Show clustering information
    configuration Show running configuration
    conntrack     Show conntrack entries in the conntrack table
    conntrack-sync
                  Show connection syncing information
    date          Show system date and time
    dhcp          Show Dynamic Host Configuration Protocol (DHCP) information
    dhcpv6        Show status related to DHCPv6
    disk          Show status of disk device
    dns           Show Domain Name Server (DNS) information
    file          Show files for a particular image
    firewall      Show firewall information
    flow-accounting
                  Show flow accounting statistics
    hardware      Show system hardware details
    history       show command history
    host          Show host information
    incoming      Show ethernet input-policy information
  : q

You can scroll up with the keys ``[Shift]+[PageUp]`` and scroll down with
``[Shift]+[PageDown]``.

When the output of a command results in more lines than can be displayed on the
terminal screen the output is paginated as indicated by a ``:`` prompt.

When viewing in page mode the following commands are available:
 * ``q`` key can be used to cancel output
 * ``space`` will scroll down one page
 * ``b`` will scroll back one page
 * ``return`` will scroll down one line
 * ``up-arrow`` and ``down-arrow`` will scroll up or down one line at a
   time respectively
 * ``left-arrow`` and ``right-arrow`` can be used to scroll left or right
   in the event that the output has lines which exceed the terminal size.

To enter configuration mode use the ``configure`` command:

.. code-block:: console

  vyos@vyos:~$ configure
  [edit]
  vyos@vyos:~#

.. note:: Prompt changes from ``$`` to ``#``. To exit configuration mode,
   type ``exit``.

.. code-block:: console

  vyos@vyos:~# exit
  exit
  vyos@vyos:~$

See the configuration section of this document for more information on
configuration mode.