- cd
- cdp advertise
- cdp enable (global)
- cdp enable (interface or port channel)
- cdp format device-id
- cdp holdtime
- cdp timer
- check logflash
- clear accounting log
- clear cdp
- clear cli history
- clear cores
- clear counters
- clear debug-logfile
- clear line
- clear logging logfile
- clear logging session
- clear ntp statistics
- clear ssh hosts
- clear system reset-reason
- clear user
- cli var name
- clock set
- clock summer-time
- clock timezone
- configure terminal
- control vlan
- copy
- copy running-configuration starting-configuration
C Commands
This chapter describes the Cisco Nexus 1010 commands that begin with the letter C.
cd
To change to a different directory from the one you are currently working in, use the cd command.
cd [filesystem:[//directory] | directory]
Syntax Description
filesystem: |
(Optional) Name of the file system. Valid file systems are bootflash and volatile. |
//directory |
(Optional) Name of the directory. The directory name is case sensitive. |
Defaults
bootflash
Command Modes
Any
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
You can only change to the directories that are on the active VSM.
Use the present working directory (pwd) command to verify the name of the directory you are currently working in.
Examples
This example shows how to change to a different directory on the current file system:
n1010# cd my-scripts
This example shows how to change from the file system you are currently working in to a different file system:
n1010# cd volatile:
This example shows how to revert back to the default directory, bootflash:
n1010# cd
Related Commands
|
|
---|---|
pwd |
Displays the name of the directory you are currently working in. |
cdp advertise
To specify the Cisco Discovery Protocol (CDP) version to advertise, use the cdp advertise command. To remove the cdp advertise configuration, use the no form of this command.
cdp advertise {v1 | v2}
no cdp advertise [v1 | v2]
Syntax Description
v1 |
CDP Version 1. |
v2 |
CDP Version 2. |
Defaults
CDP Version 2
Command Modes
Global configuration (config)
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to set CDP Version 1 as the version to advertise:
n1010(
config)#
cdp advertise v1
This example shows how to remove CDP Version 1 as the configuration to advertise:
n1010(
config)#
no cdp advertise v1
Related Commands
|
|
---|---|
show cdp |
Displays the CDP configuration. |
cdp enable (global)
To enable the Cisco Discovery Protocol (CDP) globally on all interfaces and port channels, use the cdp enable command. To disable CDP globally, use the no form of this command.
cdp enable
no cdp enable
Syntax Description
This command has no arguments or keywords.
Defaults
Enabled on all interfaces and port channels
Command Modes
Global configuration (config)
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
CDP can only be configured on physical interfaces and port channels.
Examples
This example shows how to enable CDP globally and then show the CDP configuration:
n1010# config t
n1010(config)# cdp enable
n1010(config)# show cdp global
Global CDP information:
CDP enabled globally
Refresh time is 60 seconds
Hold time is 180 seconds
CDPv2 advertisements is enabled
DeviceID TLV in System-Name(Default) Format
This example shows how to disable CDP globally and then show the CDP configuration:
n1010(
config)#
no cdp enable
n1010# show cdp global
Global CDP information:
CDP disabled globally
Refresh time is 60 seconds
Hold time is 180 seconds
CDPv2 advertisements is enabled
DeviceID TLV in System-Name(Default) Format
n1010(config)#
Related Commands
|
|
---|---|
show cdp |
Displays the CDP configuration. |
cdp enable (interface or port channel) |
Enables CDP on an interface or port channel. |
cdp enable (interface or port channel)
To enable the Cisco Discovery Protocol (CDP) on an interface or port channel, use the cdp enable command. To disable it, use the no form of this command.
cdp enable
no cdp enable
Syntax Description
This command has no arguments or keywords.
Defaults
None
Command Modes
Interface configuration (config-if)
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
CDP can only be configured on physical interfaces and port channels.
Examples
This example shows how to enable CDP on port channel 2:
n1010# config t
n1010(config)# interface port-channel2
n1010(config-if)# cdp enable
n1010(config-if)#
This example shows how to disable CDP on mgmt0:
n1010# config t
n1010(config)# interface mgmt0
n1010(config-if)# no cdp enable
n1010(config-if)# show cdp interface mgmt0
mgmt0 is up
CDP disabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
n1010(config-if)#
Related Commands
cdp format device-id
To specify the device ID format for Cisco Discovery Protocol (CDP), use the cdp format device-id command. To remove it, use the no form of this command.
cdp format device-id {mac-address | serial-number | system-name}
no cdp format device-id {mac-address | serial-number | system-name}
Syntax Description
mac-address |
Specifies the MAC address of the Chassis. |
serial-number |
Specifies the Chassis serial number. |
system-name |
Specifies the System name/Fully Qualified Domain Name (default). |
Defaults
System name/Fully Qualified Domain Name
Command Modes
Global configuration (config)
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
CDP must be enabled globally before you configure the device ID format.
You can configure CDP on physical interfaces and port channels only.
Examples
This example shows how to configure the CDP device ID with the MAC address format and then display the configuration:
n1010(
config)#
cdp format device-id mac-address
n1010
(config)# show cdp global
Global CDP information:
CDP enabled globally
Sending CDP packets every 5 seconds
Sending a holdtime value of 10 seconds
Sending CDPv2 advertisements is disabled
Sending DeviceID TLV in Mac Address Format
This example shows how to remove the CDP device ID MAC address format from the configuration:
n1010(
config)#
no cdp format device-id mac-address
Related Commands
cdp holdtime
To set the maximum amount of time that Cisco Discovery Protocol (CDP) holds onto neighbor information before discarding it, use the cdp holdtime command. To remove the CDP holdtime configuration, use the no form of this command.
cdp holdtime seconds
no cdp holdtime seconds
Syntax Description
seconds |
Maximum time that CDP holds on to neighbor information. The range is from 10 to 255 seconds. |
Defaults
180 seconds
Command Modes
Global configuration (config)
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
CDP must be enabled globally before you configure the device ID format.
You can configure CDP on physical interfaces and port channels only.
Examples
This example shows how to set the CDP holdtime to 10 second:
n1010(
config)#
cdp holdtime 10
This example shows how to remove the CDP holdtime configuration:
n1010(
config)#
no cdp holdtime 10
Related Commands
|
|
---|---|
show cdp |
Displays the CDP configuration. |
show cdp neighbors |
Displays the upstream device from your device. |
cdp timer
To set the refresh time for Cisco Discovery Protocol (CDP) to send advertisements to neighbors, use the cdp timer command. To remove the CDP timer configuration, use the no form of this command.
cdp timer seconds
no cdp timer seconds
Syntax Description
seconds |
Time before CDP sends advertisements to neighbors. The range is from 5 to 254 seconds. |
Defaults
60 seconds
Command Modes
Global configuration (config)
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to configure the CDP timer to 10 seconds:
n1010(
config)#
cdp timer 10
This example shows how to remove the CDP timer configuration:
n1010(
config)#
no cdp timer 10
Related Commands
|
|
---|---|
show cdp |
Displays the CDP configuration. |
show cdp neighbors |
Displays the upstream device from your device. |
check logflash
To check the compactFlash, use the check logflash command.
check logflash [bad-blocks]
Syntax Description
bad-blocks |
(Optional) Finds bad blocks in compactFlash. |
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to check compactFlash:
n1010# check logflash
clear accounting log
To clear the accounting log, use the clear accounting log command.
clear accounting log
Syntax Description
This command has no arguments or keywords.
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear the accounting log:
n1010# clear accounting log
Related Commands
|
|
---|---|
show accounting log |
Displays the accounting log contents. |
clear cdp
To clear the Cisco Discovery Protocol (CDP) information on an interface, use the clear cdp command.
clear cdp {counters [interface slot/port] | table [interface slot/port]}
Syntax Description
Defaults
None
Command Modes
Any
network-admin
network-operator
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear CDP counters on all interfaces:
n1010#
clear cdp counters
This example shows how to clear the CDP cache on all interfaces:
n1010#
clear cdp table
Related Commands
|
|
---|---|
show cdp |
Displays the CDP configuration. |
show cdp neighbor |
Displays the CDP configuration. |
clear cli history
To clear the history of commands you have entered into the CLI, use the clear cli history command.
clear cli history
Syntax Description
This command has no arguments or keywords.
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
Use the show cli history command to display the history of the commands that you entered at the CLI.
Examples
This example shows how to clear the command history:
n1010# clear cli history
Related Commands
|
|
---|---|
show cli history |
Displays the command history. |
clear cores
To clear the core files, use the clear cores command.
clear cores [archive]
Syntax Description
archive |
(Optional) Clears the core file on the logflash file system. |
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
Use the show system cores command to display information about the core files.
Examples
This example shows how to clear the core file:
n1010# clear cores
This example shows how to clear the core on the logflash file system:
n1010# clear cores archive
Related Commands
|
|
---|---|
check logflash |
Checks the compactFlash. |
clear counters
To clear interface counters, use the clear counters command.
clear counters [interface {all | ethernet slot/port | loopback virtual-interface-number | mgmt | port-channel port-channel-number | vethernet interface-number}]
Syntax Description
Defaults
None
Command Modes
Any
network-admin
network-operator
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear the Ethernet interface counters:
n1010(
config)#
clear counters ethernet 2/1
Related Commands
|
|
---|---|
show interface counters |
Displays the interface status, which includes the counters. |
clear debug-logfile
To clear the contents of the debug logfile, use the clear debug-logfile command.
clear debug-logfile filename
Syntax Description
filename |
Name of the debug logfile to clear. |
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear the debug logfile:
n1010# clear debug-logfile syslogd_debugs
Related Commands
|
|
---|---|
debug logfile |
Configures a debug logging file. |
debug logging |
Enable debug logging. |
show debug logfile |
Displays the contents of the debug logfile. |
clear line
To end a session on a specified virtual tty (vty), use the clear line command.
clear line word
Syntax Description
word |
vty name. |
Defaults
None
Command Modes
Any
network-admin
network-operator
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to end a session on a specified vty:
n1010(
config)#
clear line
Related Commands
|
|
---|---|
show users |
Displays active user sessions. |
clear logging logfile
To clear messages from the logging file, use the clear logging logfile command.
clear logging logfile
Syntax Description
This command has no arguments or keywords.
Defaults
None
Command Modes
Any
Super user
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear messages from the logging file:
n1010# clear logging logfile
n1010#
Related Commands
|
|
---|---|
show logging logfile |
Displays the logs in the local log file. |
clear logging session
To clear the current logging session, use the clear logging session command.
clear logging session
Syntax Description
This command has no arguments or keywords.
Defaults
None
Command Modes
Any
Super user
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
Examples
This example shows how to clear the current logging session:
n1010# clear logging session
n1010#
Related Commands
clear ntp statistics
To clear the Network Time Protocol (NTP) statistics, use the clear ntp statistics command.
clear ntp statistics {all-peers | io | local | memory}
Syntax Description
all-peers |
Clears statistics for all NTP peers. |
io |
Clears IO statistics. |
local |
Clears local statistics. |
memory |
Clears memory statistics. |
Defaults
None
Command Modes
Any
network-admin
network-operator
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear statistics for all NTP peers:
n1010(
config)#
clear ntp statistics all-peers
Related Commands
|
|
---|---|
show ntp peers |
Displays information about NTP peers. |
clear ssh hosts
To clear the Secure Shell (SSH) host sessions, use the clear ssh hosts command.
clear ssh hosts
Syntax Description
This command has no arguments or keywords.
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear all SSH host sessions:
n1010# clear ssh hosts
Related Commands
|
|
---|---|
ssh server enable |
Enables the SSH server. |
clear system reset-reason
To clear the switch reset-reason history, use the clear system reset-reason command.
clear system reset-reason
Syntax Description
This command has no arguments or keywords.
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to clear the reset-reason history for the switch:
n1010# clear system reset-reason
Related Commands
|
|
---|---|
show system resources |
Displays system-related CPU and memory statistics. |
clear user
To clear a user session, use the clear user command.
clear user user-id
Syntax Description
user-id |
User identifier. |
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
Use the show users command to display the current user sessions on the switch.
Examples
This example shows how to clear all SSH host sessions:
n1010# clear user user1
Related Commands
|
|
---|---|
show users |
Displays the user session information. |
cli var name
To define a CLI variable for a terminal session, use the cli var name command. To remove the CLI variable, use the no form of this command.
cli var name variable-name variable-text
cli no var name variable-name
Syntax Description
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
You can reference a CLI variable using the following syntax:
$(variable-name)
Instances where you can use variables in include the following:
•Command scripts
•Filenames
You cannot reference a variable in the definition of another variable.
You can use the predefined variable, TIMESTAMP, to insert the time of day. You cannot change or remove the TIMESTAMP CLI variable.
You must remove a CLI variable before you can change its definition.
Examples
This example shows how to define a CLI variable:
n1010# cli var name testinterface interface 2/3
This example shows how to reference the TIMESTAMP variable:
n1010# copy running-config > bootflash:run-config-$(TIMESTAMP).cnfg
This example shows how to remove a CLI variable:
n1010# cli no var name testinterface interface 2/3
Related Commands
|
|
---|---|
show cli variables |
Displays the CLI variables. |
clock set
To manually set the clock, use the clock set command.
clock set time day month year
Syntax Description
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
Use the clock set command when you cannot synchronize your device with an outside clock source, such as NTP.
Examples
This example shows how to manually set the clock:
n1010# clock set 9:00:00 1 June 2008
Related Commands
|
|
---|---|
clock summer-time |
Configures the summer-time (daylight saving time) offset. |
clock timezone |
Configures the time zone offset from Coordinated Universal Time (UTC). |
clock summer-time
To configure the summer-time (daylight saving time) offset, use the clock summer-time command. To revert to the default, use the no form of this command.
clock summer-time zone-name start-week start-day start-month start-time end-week end-day end-month end-time offset-minutes
no clock summer-time
Syntax Description
Defaults
None
Command Modes
Global configuration (config)
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to configure the offset for summer-time or daylight saving time:
n1010# configure terminal
n1010(config)# clock summer-time PDT 1 Sunday March 02:00 1 Sunday November 02:00 60
This example shows how to remove the summer-time offset:
n1010# configure terminal
n1010(config)# no clock summer-time
Related Commands
|
|
---|---|
clock set |
Sets the clock, manually. |
clock timezone |
Configures the time zone offset from Coordinated Universal Time (UTC). |
clock timezone
To configure the time zone offset from Coordinated Universal Time (UTC), use the clock timezone command. To revert to the default, use the no form of this command.
clock timezone zone-name offset-hours offset-minutes
no clock timezone
Syntax Description
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
Examples
This example shows how to configure the time zone offset from UTC:
n1010# clock timezone EST 5 0
This example shows how to remove the time zone offset:
n1010# no clock timezone
Related Commands
|
|
---|---|
clock set |
Sets the clock, manually. |
clock summer-time |
Configures the summer-time (daylight saving time) offset. |
configure terminal
To enter global configuration mode, use the configure terminal command.
configure terminal
Syntax Description
This command has no arguments or keywords
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
The configuration changes you make in the Global configuration mode are saved in the running configuration file. To save these changes persistently across reboots and restarts, you must copy them to the startup configuration file using the copy running-config startup-config command.
Examples
This example shows how to enter global configuration mode:
n1010#
configure terminal
n1010(
config)#
Related Commands
|
|
---|---|
exit |
Exits a configuration mode. |
copy running-config startup-config |
Copies the running configuration to the startup configuration. |
control vlan
To modify the VLAN ID of the Virtual Supervisor Module (VSM) domain control VLAN, use the control vlan command.
control vlan vlan-id
Syntax Description
vlan-id |
Number that identifies the VSM domain control VLAN. The range is from 1 to 3967 and 4048 to 4093. |
Defaults
None
Command Modes
SVS domain configuration (config-svs-domain)
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Examples
This example shows how to modify the VLAN ID of the VSM domain control VLAN to be 1116:
n1010#
configure terminal
n1010(
config)#
svs-domain
n1010(config-svs-domain)#
control vlan 1116
Related Commands
copy
To copy a file from a source to a destination, use the copy command.
copy source-url destination-url
Syntax Description
The format of the source and destination URLs varies according to the file or directory location. You may enter either a CLI variable for a directory or a filename that follows the Cisco NX-OS file system syntax (filesystem:[/directory][/filename]).
The following tables list URL prefix keywords by the file system type. If you do not specify a URL prefix keyword, the device looks for the file in the current directory.
Table 1 lists URL prefix keywords for bootflash and remote writable storage file systems.
Table 2 lists the URL prefix keywords for nonwritable file systems.
Defaults
The default name for the destination file is the source filename.
Command Modes
Any
network-admin
Command History
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
The entire copying process may take several minutes, depending on the network conditions and the size of the file, and differs from protocol to protocol and from network to network.
The colon character (:) is required after the file system URL prefix keywords (such as bootflash).
In the URL syntax for ftp:, scp:, sftp:, and tftp:, the server is either an IP address or a hostname.
Examples
This example shows how to copy a file within the same directory:
n1010# copy file1 file2
This example shows how to copy a file to another directory:
n1010# copy file1 my_files:file2
This example shows how to copy a file to another VSM:
n1010# copy file1 bootflash://sup-remote/file1.bak
This example shows how to copy a file from a remote server:
n1010# copy scp://10.10.1.1/image-file.bin bootflash:image-file.bin
Related Commands
copy running-configuration starting-configuration
To copy the running configuration to the startup configuration, use the copy running-configuration starting-configuration command.
copy running-configuration starting-configuration
Syntax Description
This command has no arguments or keywords
Defaults
None
Command Modes
Any
network-admin
Command History
|
|
4.0(4)SP1(1) |
This command was introduced. |
Usage Guidelines
Use the copy running-configuration starting-configuration command to save configuration changes in the running configuration to the startup configuration in persistent memory. When a device reload or switchover occurs, the saved configuration is applied.
Examples
This example shows how to copy the running configuration to the startup configuration:
n1010# copy running-config startup-config
[########################################] 100%

Note This example also shows how to use a shortened version of the copy running-configuration starting-configuration command