mv

mv old_name new_name

Description

Moves a file from the specified file system or relative to the current working directory to another file on the specified file system or relative to the current working directory.

Syntax Description

old_name Specifies the current name of the configuration or policy file on the system.
new_name Specifies the new name of the configuration or policy file on the system.

Default

N/A.

Usage Guidelines

Use this command to move a file from the specified file system or relative to the current working directory to another file on the specified file system or relative to the current working directory. This command provides the functionality to relocate an existing file by creating a new entry in the file system, linking the content of the existing file to the new one and removing the old entry. If given a different name, the new file can be created in the same directory as the existing file
  • XML-formatted configuration files have the .cfg file extension. The switch only runs .cfg files.
  • ASCII-formatted configuration files have the .xsf file extensions. For more information, see the Software Upgrade and Boot Options section in the ExtremeXOS 32.1 User Guide .
  • Policy files have the .pol file extension.
  • Core dump files have the .gz file extension. For more information, see the Internal Memory and Core Dump Files section in the ExtremeXOS 32.1 User Guide .

Make sure the renamed file uses the same file extension as the original file. If you change the file extensions, the file may be unrecognized by the system. For example, if you have an existing configuration file named test.cfg, the new file name must include the .cfg file extension.

You cannot rename an active configuration file (the configuration currently selected to boot the switch). To verify the configuration that you are currently using, run the show switch {detail} command. If you attempt to rename the active configuration file, the switch displays a message similar to the following:

 Error: Cannot rename current selected active configuration file. 

When you rename a file, the switch displays a message similar to the following:

 Rename config test.cfg to config megtest.cfg on switch? (y/n) 

Type y to rename the file on your system. Type n to cancel this process and keep the existing file name.

Case-Sensitive File Names

File names are case-sensitive. For example, if you have a configuration file named Test.cfg, and you attempt to rename the file with the incorrect case, for example test.cfg, the switch displays a message similar to the following:

 Error: mv: unable to rename `/config/test.cfg': No such file or directory 

Since the switch is unable to locate test.cfg, the file is not renamed.

Local File Name Character Restrictions

When specifying a local file name, the switch permits only the following characters:
  • Alphabetical letters, upper case and lower case (A-Z, a-z).
  • Numerals (0-9).
  • Period ( . ).
  • Dash ( - ).
  • Underscore ( _ ).

Internal Memory and Core Dump Files

Core dump files have a .gz file extension. The file name format is: core.process-name.pid.gz, where process-name indicates the name of the process that failed and pid is the numerical identifier of that process.

When you configure the switch to send core dump (debug) information to internal memory, specify the file path /usr/local/tmp to rename an existing core dump file. If you have a switch with a USB storage device installed, you can move and rename the core dump file to that location.

For information about configuring and saving core dump information, see the configure debug core-dumps [ off | directory_path] and save debug tracefiles directory_path commands.

Example

The following command renames the configuration file named Testb91.cfg to Activeb91.cfg:

# mv Testb91.cfg Activeb91.cfg

The following example moves the configuration file named test1.cfg from the switch to the USB storage device:

# mv test1.cfg /usr/local/ext/test1.cfg

The following example moves the policy file named bgp.pol from the USB storage device to the switch:

# mv /usr/local/ext/bgp.pol bgp.pol

History

This command was first available in ExtremeXOS 10.1.

The memorycard option was added in ExtremeXOS 11.1.

The internal-memory option was added in ExtremeXOS 11.4.

Support for USB 2.0 storage devices was added in ExtremeXOS 12.5.3.

Path name support was added in ExtremeXOS 15.5.1.

Platform Availability

This command is available on ExtremeSwitching X435, X440-G2, X450-G2, X460-G2, X465, X590, X620, and X695 series switches.