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. See Software Upgrade and Boot Options for more information.
  • Policy files have the .pol file extension.
  • Core dump files have the .gz file extension. See Internal Memory and Core Dump Files for more information.

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 filename 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, issue 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) 

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

The memorycard option moves files between a removable storage device and the switch. If you use the memorycard option for both the old-name and the new-name, this command just renames a file on the removable storage device.

Case-sensitive Filenames

Filenames are case-sensitive. In this example, you have a configuration file named Test.cfg. If 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 Filename Character Restrictions

This section provides information about the characters supported by the switch for local filenames.

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

When naming a local or remote file, remember the requirements listed above.

Internal Memory and Core Dump Files

Core dump files have a .gz file extension. The filename 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. If you have a BlackDiamond 8800 series switch and save core dump files to the compact flash card, the filename also includes the affected MSM/MM: MSM-A or MSM-B.

When you configure the switch to send core dump (debug) information to the internal memory card, specify the internal-memory option to rename an existing core dump file. If you have a switch with a removable storage device installed, you can move and rename the core dump file to that location.

For information about configuring and sending core dump information to the internal memory card, see the configure debug core-dumps and save debug tracefiles memorycard commands.

Modular Switches Only

This command also replicates the action from the primary MSM/MM to the backup MSM/MM. For example, when you rename a file on the primary MSM/MM, the same file on the backup MSM/MM is renamed.

Example

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

mv Testb91.cfg Activeb91.cfg

On a switch with a removable storage device installed, the following command moves the configuration file named test1.cfg from the switch to the removable storage device:

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

If you do not change the name of the configuration file, you can also use the following command to move the configuration file test1.cfg from the switch to a removable storage device:

mv /usr/local/ext

On a switch with a removable storage device installed, the following command moves the policy file named bgp.pol from the removable storage device to the switch:

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

History

This command was first available in ExtremeXOS 10.1.

Support for replicating information from the primary MSM to the backup MSM was introduced in ExtremeXOS 11.0.

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.

Pathname support was added in ExtremeXOS 15.5.1.

Platform Availability

This command is available on all platforms.