clear counters
To clear the interface counters, use the clear countersinterface command in EXEC mode mode.
clear counters interface [all | type interface-path-id]
Syntax Description
interface |
Specifies interfaces. |
||
all |
(Optional) Clears counters on all interfaces. |
||
type |
(Optional) Interface type. For more information, use the question mark (? ) online help function. |
||
interface-path-id |
(Optional) Physical interface or virtual interface.
For more information about the syntax for the router, use the question mark (? ) online help function. |
Command Default
Counters for all interfaces are cleared.
Command Modes
EXEC mode
Command History
Release |
Modification |
---|---|
Release 3.7.2 |
This command was introduced. |
Release 6.0.x |
This command was was modified. The interface was introduced |
Usage Guidelines
Use the clear counters command to clear all the statistics counters displayed by the show interfaces command. If no optional arguments are supplied or if the all keyword is specified, then the counters for all interfaces are cleared. If an interface type is specified, then only the counters for that interface are cleared.
The clear counters command with the all option clears counters on all interfaces. When you enter this command, the system prompts you for confirmation. You must then press Enter or the y key for the clear counters command to take effect.
Note |
This command does not clear counters retrieved using Simple Network Management Protocol (SNMP), but only those counters displayed with the show interfaces command. |
Task ID
Task ID |
Operations |
---|---|
interface |
execute |
Examples
This example shows how to clear counters on all interfaces:
RP/0/RSP0/CPU0:router# clear counters interface all
Clear "show interface" counters on all interfaces [confirm]
This example shows how to clear the interface counters for Packet-over-SONET/SDH (POS) interface 0/1/0/0:
RP/0/RSP0/CPU0:router# clear counters interface POS 0/1/0/0
Clear "show interface" counters on this interface [confirm]