[an error occurred while processing this directive][an error occurred while processing this directive]

Using Regular Expressions to Delete Related Items from a JUNOS Configuration

The JUNOS command-line interface (CLI) enables you to delete related configuration items simultaneously, such as channelized interfaces or static routes, by using a single command and regular expressions. Deleting a statement or an identifier effectively “unconfigures” the functionality associated with that statement or identifier, returning that functionality to its default condition.

You can only delete certain parts of the configuration where you normally put multiple items, for example, interfaces. However, you cannot delete "groups" of different items; for example:

user@host# show system servicesftp;rlogin;rsh;ssh { root-login allow;}telnet;[edit]user@host# wildcard delete system services *syntax error.

When you delete a statement, the statement and all its subordinate statements and identifiers are removed from the configuration.

To delete related configuration items, issue the wildcard configuration mode command with the delete option and specify the statement path, the items to be summarized with a regular expression, and the regular expression.

user@host# wildcard delete <statement-path> <identifier> <regular-expression>

Note: When you use the wildcard command to delete related configuration items, the regular expression must be the final statement.

If the JUNOS Software matches more than eight related items, the CLI displays only the first eight items.

Deleting Interfaces from the Configuration

Delete multiple T1 interfaces in the range from t1-0/0/0:0 through t1-0/0/0:23:

user@host# wildcard delete interfaces t1-0/0/0:.* matched: t1-0/0/0:0 matched: t1-0/0/0:1 matched: t1-0/0/0:2 Delete 3 objects? [yes,no] (no) no

Deleting Routes from the Configuration

Delete static routes in the range from to

user@host# wildcard delete routing-options static route 172.* matched: matched: matched: matched: matched: matched: matched: matched: ... Delete 13 objects? [yes,no] (no)

Published: 2010-04-27

[an error occurred while processing this directive]