Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • add - this command usually has all the same arguments as set, except the item number argument. It adds a new item with the values you have specified, usually at the end of the item list, in places where the order of items is relevant. There are some required properties that you have to supply, such as the interface for a new address, while other properties are set to defaults unless you explicitly specify them.
    • Common Parameters
      • copy-from - Copies an existing item. It takes default values of new item's properties from another item. If you do not want to make exact copy, you can specify new values for some properties. When copying items that have names, you will usually have to give a new name to a copy
      • place-before - places a new item before an existing item with specified position. Thus, you do not need to use the move command after adding an item to the list
      • disabled - controls disabled/enabled state of the newly added item(-s)
      • comment - holds the description of a newly created item
    • Return Values
      • add command returns internal number of item it has added
  • edit - this command is associated with the set command. It can be used to edit values of properties that contain a large amount of text, such as scripts, but it works with all editable properties. Depending on the capabilities of the terminal, either a fullscreen editor, or a single line editor is launched to edit the value of the specified property.
  • find - The find command has the same arguments as set, plus the flag arguments like disabled or active that take values yes or no depending on the value of respective flag. To see all flags and their names, look at the top of print command's output. The find command returns internal numbers of all items that have the same values of arguments as specified.
  • move - changes the order of items in list.
    • Parameters
      • first argument specifies the item(-s) being moved.
      • the second argument specifies the item before which to place all items being moved (they are placed at the end of the list if the second argument is omitted).
  • print - shows all information that's accessible from particular command level. Thus, /system clock print shows system date and time, /ip route print shows all routes, etc. If there's a list of items in current level and they are not read-only, i.e. you can change/remove them (example of read-only item list is /system history, which shows a history of executed actions), then print command also assigns numbers that are used by all commands that operate with items in this list.
    • Common Parameters
      • from - show only specified items, in the same order in which they are given.
      • where - show only items that match specified criteria. The syntax of where the property is similar to the find command.
      • brief - forces the print command to use tabular output form
      • detail - forces the print command to use property=value output form
      • count-only - shows the number of items
      • file - prints the contents of the specific submenu into a file on the router.
      • interval - updates the output from the print command for every interval seconds.
      • oid - prints the OID value for properties that are accessible from SNMP
      • without-paging - prints the output without stopping after each screenful.
  • remove - removes specified item(-s) from a list.
  • set - allows you to change values of general parameters or item parameters. The set command has arguments with names corresponding to values you can change. Use ? or double [Tab] to see list of all arguments. If there is a list of items in this command level, then set has one action argument that accepts the number of item (or list of numbers) you wish to set up. This command does not return anything.
Info

You can combine commands, here are two variants of the same command that will place a new firewall filter entry, by looking up comment:

/ip firewall/filter/add chain=forward place-before=[find where comment=CommentX]
/ip/firewall/filter/add chain=forward place-before="CommentX"


Modes

Console line editor works either in multiline mode or in single-line mode. In multiline mode line editor displays complete input line, even if it is longer than single terminal line. It also uses a full-screen editor for editing large text values, such as scripts. In single-line mode only one terminal line is used for line editing, and long lines are shown truncated around the cursor. A full-screen editor is not used in this mode.

Choice of modes depends on detected terminal capabilities.

...

List of keys

Control-C keyboard interrupt. Control-D log out (if input line is empty)Control-K clear from cursor to the end of lineControl-X toggle safe modeControl-V toggle hotlock mode modeF6 toggle cellarF1 or ? show context sensitive help. If the previous character is \, then inserts literal ?.Tab perform line completion. When pressed second time, show possible completions.Delete remove character at cursorControl-H or Backspace remove character before cursor and move cursor back one position.Control-\ split line at cursor. Insert newline at cursor position. Display second of the two resulting lines.Control-B or Left move cursor backwards one characterControl-F or Right move cursor forward one characterControl-P or Up go to previous line. If this is the first line of input then recall previous input from history.Control-N or Down go to next line. If this is the last line of input then recall next input from history.Control-A or Home move cursor to the beginning of the line. If cursor is already at the beginning of the line, then go to the beginning of the first line of current input.Control-E or End move cursor to the end of line. If cursor is already at the end of line, then move it to the end of the last line of current input.Control-L or F5 reset terminal and repaint screen.

...