C Commands
This chapter describes the basic Cisco NX-OS system commands that begin with C.
cd
To change the current working directory in the device file system, use the cd command.
cd [ filesystem :] [// server /] directory
Syntax Description
Note There can be no spaces in the filesystem://server/directory string. Individual elements of this string are separated by colons (:) and slashes (/).
Command Default
Command Modes
Command History
|
|
---|---|
Usage Guidelines
Use the pwd command to verify the current working directory.
Examples
This example shows how to change the current working directory on the current file system:
This example shows how to change the current working directory to another file system:
Related Commands
|
|
---|---|
clear cli history
To clear the command history, use the clear cli history command.
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
Usage Guidelines
Use the show cli history command to display the history of the commands that you entered at the command-line interface (CLI).
Examples
This example shows how to clear the command history:
Related Commands
|
|
---|---|
clear cores
To clear the core files, use the clear cores command.
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
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:
Related Commands
|
|
---|---|
clear debug-logfile
To clear the contents of the debug log file, use the clear debug-logfile command.
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
Examples
This example shows how to clear the debug log file:
Related Commands
|
|
---|---|
clear install failure-reason
To clear the reason for software installation failures, use the clear install failure-reason command.
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
Examples
This example shows how to clear the reason for software installation failures:
Related Commands
|
|
---|---|
clear license
To uninstall a license, use the clear license command.
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
Examples
This example shows how to clear a specific license:
Related Commands
|
|
---|---|
clear user
To log out a particular user, use the clear user command.
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
Examples
This example shows how to log out a specific user:
Related Commands
|
|
---|---|
cli var name
To define a command-line interface (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
Syntax Description
Name of the variable. The name is alphanumeric, case sensitive, and has a maximum of 31 characters. |
|
Variable text. The text is alphanumeric, can contain spaces, and has a maximum of 200 characters. |
Command Default
Command Modes
Command History
|
|
---|---|
Usage Guidelines
You can reference a CLI variable using the following syntax:
Instances where you can use variables include the following:
You cannot reference a variable in the definition of another variable.
The Cisco NX-OS software provides a predefined variable, TIMESTAMP, that you can use to insert the time of day. You cannot change or remove the TIMESTAMP CLI variable.
You cannot change the definition of a CLI variable. You must remove the variable and then create it again with the new definition.
Examples
This example shows how to define a CLI variable:
This example shows how to reference a CLI variable:
This example shows how to reference the TIMESTAMP variable:
This example shows how to remove a CLI variable:
Related Commands
|
|
---|---|
clock protocol
To set the synchronization protocol for the clock to a protocol, use the clock protocol command. To remove the clock protocol, use the no form of this command.
no clock protocol { none | ntp }
Syntax Description
Specifies that the clock be set to the Network Time Protocol (NTP). |
Command Default
Command Modes
Command History
|
|
---|---|
Usage Guidelines
Examples
This example shows how to set the synchronization protocol for the clock to NTP:
Related Commands
|
|
---|---|
clock set
To manually set the clock on a Cisco Nexus 5000 Series switch, use the clock set command.
Syntax Description
Month of the year. The values are January, February, March, April, May, June, July, August, September, October, November, and December. |
|
Command Default
Command Modes
Command History
|
|
---|---|
Usage Guidelines
Use this command when you cannot synchronize the switch with an outside clock source, such as an NTP server.
Examples
This example shows how to manually configure the clock:
Related Commands
|
|
---|---|
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
Syntax Description
Command Default
Command Modes
Global configuration mode
Interface configuration mode
Command History
|
|
---|---|
Examples
This example shows how to configure the offset for summer-time or daylight saving time:
This example shows how to revert to the default offset for summer-time:
Related Commands
|
|
---|---|
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
Syntax Description
Command Default
Command Modes
Global configuration mode
Interface configuration mode
Command History
|
|
---|---|
Usage Guidelines
Examples
This example shows how to configure the time zone offset from UTC:
This example shows how to revert the time zone offset to the default:
Related Commands
|
|
---|---|
configure session
To create or modify a configuration session, use the configure session command.
Syntax Description
Name of the session. The name is a case-sensitive, alphanumeric string up to 63 characters. |
Command Default
Command Modes
Command History
|
|
---|---|
Examples
This example shows how to create a configuration session:
Related Commands
|
|
---|---|
configure terminal
To enter configuration mode, use the configure terminal command.
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
Usage Guidelines
Use this command to enter configuration mode. Commands in this mode are written to the running configuration file as soon as you enter them (using the Enter key/ Carriage Return).
After you enter the configure terminal command, the system prompt changes from switch# to switch(config)#, indicating that the switch is in configuration mode. To leave configuration mode and return to EXEC mode, type end or press Ctrl-Z.
To view the changes to the configuration that you have made, use the show running-config command.
Examples
This example shows how to enter configuration mode:
Related Commands
|
|
---|---|
Saves the running configuration as the startup configuration file. |
|
Exits from the current configuration mode to the next highest configuration mode. |
|
copy
To copy any file from a source to a destination, use the copy command.
copy source-url destination-url
Syntax Description
Command Default
The default name for the destination file is the source filename.
Command Modes
Command History
|
|
---|---|
Support for this command was introduced on external Universal Serial Bus (USB) Flash memory devices. |
Usage Guidelines
The copy command allows you to copy a file (such as a system image or configuration file) from one location to another location. The source and destination for the file is specified using a Cisco NX-OS file system URL, which allows you to specify a local or remote file location. The file system being used (such as a local memory source or a remote server) determines the syntax used in the command.
You can enter on the command line all necessary source- and destination-URL information and the username to use, or you can enter the copy command and have the CLI prompt you for any missing information.
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 IPv4 address or a hostname.
Format of Source and Destination URL
The format of the source and destination URLs varies according to the file or directory location. You can enter either a command-line interface (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 switch looks for a file in the current directory.
Table 1 lists URL prefix keywords for local writable storage file systems. Table 2 lists the URL prefix keywords for remote file systems. Table 3 lists the URL prefix keywords for nonwritable file systems.
This section contains usage guidelines for the following topics:
- Copying Files from a Server to Bootflash Memory
- Copying a Configuration File from a Server to the Running Configuration
- Copying a Configuration File from a Server to the Startup Configuration
- Copying the Running or Startup Configuration on a Server
Copying Files from a Server to Bootflash Memory
Use the copy source-url bootflash: command (for example, copy tftp: source-url bootflash:) to copy an image from a server to the local bootflash memory.
Copying a Configuration File from a Server to the Running Configuration
Use the copy { ftp: | scp: | sftp: | tftp: } source-url running-config command to download a configuration file from a network server to the running configuration of the device. The configuration is added to the running configuration as if the commands were typed in the CLI. The resulting configuration file is a combination of the previous running configuration and the downloaded configuration file. The downloaded configuration file has precedence over the previous running configuration.
You can copy either a host configuration file or a network configuration file. Accept the default value of host to copy and load a host configuration file containing commands that apply to one network server in particular. Enter network to copy and load a network configuration file that contains commands that apply to all network servers on a network.
Copying a Configuration File from a Server to the Startup Configuration
Use the copy { ftp: | scp: | sftp: | tftp: } source-url startup-config command to copy a configuration file from a network server to the switch startup configuration. These commands replace the startup configuration file with the copied configuration file.
Copying the Running or Startup Configuration on a Server
Use the copy running-config { ftp: | scp: | sftp: | tftp: } destination-url command to copy the current configuration file to a network server that uses FTP, scp, SFTP, or TFTP. Use the copy startup-config { ftp: | scp: | stfp: | tftp: } destination-url command to copy the startup configuration file to a network server.
Examples
This example shows how to copy a file within the same directory:
This example shows how to copy a file to another directory:
This example shows how to copy a file to another file system:
This example shows how to copy a file to another supervisor module:
This example shows how to copy a file from a remote server:
This example shows how to copy the kickstart and system image to bootflash:
Related Commands
|
|
---|---|
copy running-config startup-config
To save the running configuration to the startup configuration file so that all current configuration details are available after a reboot, use the copy running-config startup-config command.
copy running-config startup-config
Syntax Description
Command Default
Command Modes
Command History
|
|
---|---|
Usage Guidelines
To view the changes to the configuration that you have made, use the show startup-config command.
Note Once you enter the copy running-config startup-config command, the running and the startup copies of the configuration are identical.
Examples
This example shows how to save the running configuration to the startup configuration:
Related Commands
|
|
---|---|