MDS 05-6628A01, Rev. B
MDS Orbit MCR-4G Technical Manual
107
[ok][2007-08-31 13:49:44]
Count: 99 lines
admin@io 13:49:44> show configuration interfaces | count
[ok][2007-08-31 13:50:12]
Count: 90 lines
admin@io 13:50:12>
Search for a String in the Output
The match target is used to only include lines matching a regular
expression. For example:
admin@(none) 00:19:57> show configuration logging | match date
event-rules date_time_from_ntp {
event-rules date_time_from_user {
event-rules date_time_not_set {
[ok][2012-06-19 00:20:02]
admin@(none) 00:20:02>
In the example above only lines containing “date” are shown. Similarly lines not containing a regular
expression can be included.
admin@(none) 00:22:13> show interfaces | except counters
interfaces supported-interfaces bridge true
interfaces interface eth0
if-index 2
status mac-address 1e:ed:19:27:1a:b3
status mtu 1500
status link up
status ipv4 address [ 192.168.1.10/24 ]
status ipv6 address [ fe80::1ced:19ff:fe27:1ab3/64 ]
[ok][2012-06-19 00:22:19]
admin@(none) 00:22:19>
It is also possible to display the output starting at the first match of a regular expression, using the
find target. For example:
admin@(none) 00:23:51> show interfaces | find tx
status counters tx_aborted_errors 0
status counters tx_bytes 238574
status counters tx_carrier_errors 0
status counters tx_compressed 0
status counters tx_dropped 0
status counters tx_errors 0
status counters tx_fifo_errors 0
status counters tx_heartbeat_errors 0
status counters tx_packets 1731
status counters tx_window_errors 0
[ok][2012-06-19 00:23:53]
admin@(none) 00:23:53>
Output can also be ended when a line matches a regular expression. This is done with the until target.