- Table of Contents
-
- H3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103
- 00-Preface
- 01-CLI Command
- 02-Login Command
- 03-Configuration File Management Command
- 04-VLAN Command
- 05-Auto Detect Command
- 06-Voice VLAN Command
- 07-GVRP Command
- 08-Basic Port Configuration Command
- 09-Link Aggregation Command
- 10-Port Isolation Command
- 11-Port Security-Port Binding Command
- 12-DLDP Command
- 13-MAC Address Table Management Command
- 14-MSTP Command
- 15-802.1x and System Guard Command
- 16-AAA Command
- 17-MAC Address Authentication Command
- 18-IP Address and Performance Command
- 19-DHCP Command
- 20-ACL Command
- 21-QoS-QoS Profile Command
- 22-Mirroring Command
- 23-ARP Command
- 24-SNMP-RMON Command
- 25-Multicast Command
- 26-NTP Command
- 27-SSH Command
- 28-File System Management Command
- 29-FTP-SFTP-TFTP Command
- 30-Information Center Command
- 31-System Maintenance and Debugging Command
- 32-VLAN-VPN Command
- 33-HWPing Command
- 34-DNS Command
- 35-Smart Link-Monitor Link Command
- 36-PoE-PoE Profile Command
- 37-Routing Protocol Command
- 38-UDP Helper Command
- 39-Index
- Related Documents
-
Title | Size | Download |
---|---|---|
28-File System Management Command | 81.72 KB |
Table of Contents
1 File System Management Configuration Commands
File System Configuration Commands
File Attribute Configuration Commands
The device allows you to specify a file path and file name in one of the following ways:
l In universal resource locator (URL) format and starting with “unit1>flash:/”. or “flash:/” This method is used to specify a file in the current flash memory.
l Using the path name or file name directly. This method can be used to specify a path or a file in the current directory.
File System Configuration Commands
Note to limit the lengths of device name, directory name, file path and file name within the following ranges regulated for the device.
l A directory name should be no more than 91 characters.
l A file name plus its local path name should be no more than 127 characters.
l A device name should be no more than 14 characters.
l A file name plus its complete path name should be no more than 142 characters.
cd
Syntax
cd directory
View
User view
Parameters
directory: Target directory.
Description
Use the cd command to enter a specified directory on the device.
The default directory when a user logs onto the engine is the root directory of flash memory.
Examples
# Enter the directory named test from the root directory.
<device> cd test
<device> pwd
unit1>flash:/test
# Return to the upper directory.
<device> cd ..
copy
Syntax
copy fileurl-source fileurl-dest
View
User view
Parameters
fileurl-source: Name of the source file.
fileurl-dest: Name of the target file.
Description
Use the copy command to copy a file.
If the fileurl-dest argument identifies an existing file, the system prompts you for the confirmation to overwrite the existing file.
If the path, rather than the name of the target file is specified, the source file name is used as the target file name by default.
Examples
# Copy the file from flash:/config.cfg into flash:/test/1.cfg.
<device> copy flash:/config.cfg flash:/test/1.cfg
Copy unit1>flash:/config.cfg to unit1>flash:/test/1.cfg?[Y/N]:y
...
%Copy file unit1>flash:/config.cfg to unit1>flash:/test/1.cfg...Done.
delete
Syntax
delete [ /unreserved ] file-url
delete { running-files | standby-files } [ /unreserved ]
View
User view
Parameters
/unreserved: Specifies to delete a file completely.
file-url: Path name or file name of a file in the flash memory. You can use the * character in this argument as a wildcard. For example, the delete *.txt command deletes all the files with txt as their extensions.
running-files: Specifies to delete all the files with the main attribute.
standby-files: Specifies to delete all the files with the backup attribute.
Description
Use the delete command to delete a specified file from the flash memory on the device.
If you execute the delete command with the /unreserved keyword specified, the specified file is permanently deleted. That is, the file cannot be restored. If you execute the delete command without the /unreserved keyword, the specified file is removed to the recycle bin, and you can use the undelete command to restore it.
You can delete files based on file attribute.
l If you execute the delete running-files command, all the files with the main attribute will be deleted.
l If you execute the delete standby-files command, all the files with the backup attribute will be deleted.
For a file that has both the main and backup attributes:
l The delete running-files command only deletes its main attribute instead of the file itself.
l The delete standby-files command only deletes its backup attribute instead of the file itself.
When you use the delete running-files or delete standby-files command, you will be prompted to confirm whether to delete all files with the main/backup attribute. If you choose yes, the corresponding files are deleted. If you choose no, the system will further to prompt you to confirm the following items orderly:
1) Delete the image files with the main/backup attribute?
2) Delete the configuration files with the main/backup attribute?
3) Delete the Web files with the main/backup attribute?
The corresponding messages are displayed as follows:
Delete the running image file? [Y/N]:n
Delete the running config file? [Y/N]:n
Delete the running web file? [Y/N]:n
Delete the backup image file? [Y/N]:n
Delete the backup config file? [Y/N]:n
Delete the backup web file? [Y/N]:n
The corresponding files will be deleted after you choose yes.
For deleted files whose names are the same, only the latest deleted file is stored in the recycle bin and can be restored.
Examples
# Delete the file test/test.txt.
<device> delete test/test.txt
Delete unit1>flash:/test/test.txt?[Y/N]:y
.
%Delete file unit1>flash:/test/test.txt...Done.
# Delete the configuration files with the backup attribute in the flash.
Delete all the backup files? [Y/N]:n
Delete the backup image file? [Y/N]:n
Delete the backup config file? [Y/N]:y
Delete the backup web file? [Y/N]:n
Start deleting ...
Deleting ... done
dir
Syntax
dir [ /all ] [ file-url ]
View
User view
Parameters
/all: Specifies to display the information about all the files, including those stored in the recycle bin.
file-ur: Path name or the name of a file in the flash memory. You can use the * character as a wildcard. For example, the dir *.txt command displays the information about all the files with the extension of txt in the current directory.
Description
Use the dir command to display the information about the specified files or directories in the flash memory on the device.
Executed without the /all keyword, the dir command will not display information about files in the recycle bin; executed with the /all keyword, the dir command will display information about files in the recycle bin.
In the output information, files with the main, backup or main/backup attribute are tagged with special characters:
l main: (*)
l backup: (b)
l main/backup: (*b)
In the output information of the dir /all command, deleted files (that is, those in the recycle bin) are embraced in brackets.
Examples
# Display the information about all the ordinary files in the root directory of the file system.
<device> dir
Directory of unit1>flash:/
1 -rw- 1443 Apr 02 2000 02:45:13 startup.cfg
2 (*) -rw- 1713 Apr 01 2000 23:57:11 vrpcfg.cfg
6858 KB total (6848 KB free)
(*) -with main attribute (b) -with backup attribute
(*b) -with both main and backup attribute
# Display the information about all the files (including the files in the recycle bin) in the root directory of the file system.
<device> dir /all
Directory of unit1>flash:/
1 -rw- 1443 Apr 02 2000 02:45:13 startup.cfg
2 -rwh 151 Apr 02 2000 00:05:53 private-data.txt
3 (*) -rw- 1713 Apr 01 2000 23:57:11 vrpcfg.cfg
4 -rwh 356 Apr 02 2000 03:20:25 dsakey
5 -rwh 428 Apr 02 2000 03:21:59 hostkey
6 -rwh 572 Apr 02 2000 03:22:21 serverkey
6858 KB total (6848 KB free)
(*) -with main attribute (b) -with backup attribute
(*b) -with both main and backup attribute
# Display the information about all the files whose names begin with the character t (including those in the recycle bin) in the local directory unit1>flash:/test/.
Directory of unit1>flash:/test/
0 -rw- 556 Apr 04 2000 14:45:19 test.txt
7239 KB total (3481 KB free)
(*) -with main attribute (b) -with backup attribute
(*b) -with both main and backup attribute
execute
Syntax
execute filename
View
System view
Parameters
filename: Batch file, with the extension .bat.
Description
Use the execute command to execute the specified batch file.
This command executes command lines in the batch file in sequence.
Note that the batch file cannot contain any invisible character. If any invisible character is found, the command will quit the current execution process and the executed operations are not cancelled automatically.
The batch execution command is the automation of executing commands in a batch file. However it
l Does not guarantee that every command in the file is executed.
l Does not perform hot backup.
l Does not restrict the forms and contents of commands in the file.
Examples
# Execute the batch file named test.bat under the directory flash:/.
<device> system-view
System View: return to User View with Ctrl+Z.
[device] execute test.bat
<device>
....
%Created dir unit1>flash:/test3.
file prompt
Syntax
file prompt { alert | quiet }
View
System view
Parameters
alert: Specifies to prompt for confirmation before performing file-related operations that have potential risks.
quiet: Specifies to disable prompts for file-related operations.
Description
Use the file prompt command to configure the prompt mode for file-related operations.
By default, alert mode is used, by which the switch prompts for confirmation before performing file-related operations that have potential risks.
If you set the prompt mode of the file-related operations to quiet, the device does not prompt for confirmation before performing file-related operations. In this case, the system is more likely to be damaged due to some maloperations. For example:
l If the prompt mode is set to alert, the following messages will be displayed when you delete a file:
<device> delete unit1>flash:/te.txt
Delete unit1>flash:/te.txt?[Y/N]:y
......
%Delete file unit1>flash:/te.txt...Done.
The system waits for you to confirm for 30 seconds. If you do not input any confirmation in 30 seconds, the system cancels this file operation, as shown in the following:
<device> delete flash:/tt.txt
Delete flash:/tt.txt?[Y/N]:
<device>
l If the prompt mode is set to quiet, the following messages will be displayed when you delete a file:
<device> delete unit1>flash:/te.txt
....
%Delete file unit1>flash:/te.txt...Done.
Examples
# Set the prompt mode to quiet for file-related operations.
System View: return to User View with Ctrl+Z.
[device] file prompt quiet
fixdisk
Syntax
fixdisk device
View
User view
Parameters
device: Name of a device which must be “unit1>flash:” for the WX3000 series.
Description
Use the fixdisk command to restore space on the flash memory.
In case that space on the flash memory may become unavailable for reasons such as abnormal operations, you can run this command to restore the space.
Examples
# Restore space on the flash memory.
<device> fixdisk unit1>flash:
Fixdisk flash: may take some time to complete.
%Fixdisk unit1>flash: completed.
format
Syntax
format device
View
User view
Parameters
device: Name of a device which must be “unit1>flash:” for the WX3000 series.
Description
Use the format command to format the flash memory.
The format operation leads to the loss of all the files on the flash memory, and the operation is irretrievable.
Examples
# Format the flash memory.
All data on unit1>flash: will be lost , proceed with format ? [Y/N]:y
..............................
%Format unit1>flash: completed.
mkdir
Syntax
mkdir directory
View
User view
Parameters
directory: Name of a directory.
Description
Use the mkdir command to create a subdirectory in the specified directory of a flash memory.
Note that the names of the directories and files in the same directory must be unique.
Examples
# Create a directory in the current directory, with the name being dd.
....
%Created dir unit1>flash:/dd.
more
Syntax
more file-url
View
User view
Parameters
file-url: Path name or file name of a file in the flash memory.
Description
Use the more command to display the contents of a specified file.
Currently, the file system only supports to display the contents of text files.
Examples
# Display the content of the file named test.txt.
AppWizard has created this test application for you.
This file contains a summary of what you will find in each of the files that make up your test application.
Test.dsp
This file (the project file) contains information at the project level and is used to build a single project or subproject. Other users can share the project (.dsp) file, but they should export the makefiles locally.
# Display the content of the file testcfg.cfg.
<device> more testcfg.cfg
#
sysname device
#
configure-user count 5
#
vlan 2
#
return
<device>
move
Syntax
move fileurl-source fileurl-dest
View
User view
Parameters
fileurl-source: Name of the source file.
fileurl-dest: Name of the target file.
Description
Use the move command to move a file to a specified directory.
If the target file name is the same as an existing file, the system prompts you for the confirmation to overwrite the existing file.
If the path, rather than the name of the target file is specified, the source file name is used as the target file name by default.
Examples
# Move the file named 1.txt from unit1>flash:/ to unit1>flash:/a/, with the name unchanged.
<device>move unit1>flash:/1.txt unit1>flash:/a/
Move unit1>flash:/1.txt to unit1>flash:/a/1.txt?[Y/N]:y
.
%Moved file unit1>flash:/1.txt to unit1>flash:/a/1.txt.
# Move the file unit1>flash:/22.txt to unit1>flash:/test/, and overwrite the file in the directory unit1>flash:/test.
<device>move 22.txt unit1>flash:/test
Move unit1>flash:/22.txt to unit1>flash:/test/22.txt?[Y/N]:y
The file unit1>flash:/test/22.txt exists. Overwrite it?[Y/N]:y
The file will be permanently deleted from flash, please wait.
....
%Moved file unit1>flash:/22.txt to unit1>flash:/test/22.txt.
pwd
Syntax
pwd
View
User view
Parameters
None
Description
Use the pwd command to display the current working path of the login user.
Examples
# Display the current working path.
<device> pwd
unit1>flash:
rename
Syntax
rename fileurl-source fileurl-dest
View
User view
Parameters
fileurl-source: Original path name or file name of a file in the flash memory.
fileurl-dest: Target path name or file name.
Description
Use the rename command to rename a file or a directory.
If the target file name or directory name is the same with any existing file name or directory name, you will fail to perform the rename operation.
Examples
# Rename the file named config.txt to config.bak.
<device>rename config.txt config.bak
Rename unit1>flash:/config.txt to unit1>flash:/config.bak?[Y/N]:y
.
%Renamed file unit1>flash:/config.txt to unit1>flash:/config.bak.
reset recycle-bin
Syntax
reset recycle-bin [ file-url ] [ /force ]
View
User view
Parameters
file-url: Path name or file name of a file in the flash memory. This argument supports the wildcard “*”.
/force: Specifies not to prompt for confirmation before deleting files.
Description
Use the reset recycle-bin command to clear the recycle bin in the flash memory.
The files deleted by the delete command without the /unreserved keyword are moved to the recycle bin. To delete them permanently, you can use the reset recycle-bin command.
Examples
# Clear the recycle bin.
<device>reset recycle-bin unit1>flash:/
Clear unit1>flash:/te.txt ?[Y/N]:y
Clearing files from flash may take a long time. Please wait...
.....
%Cleared file unit1>flash:/~/te.txt.
rmdir
Syntax
rmdir directory
View
User view
Parameters
directory: Name of a directory.
Description
Use the rmdir command to delete a directory.
As only empty directories can be deleted, you need to clear a directory before deleting it.
Examples
# Delete the directory named dd.
Rmdir unit1>flash:/dd?[Y/N]:y
....
%Removed directory unit1>flash:/dd.
undelete
Syntax
undelete file-url
View
User view
Parameters
file-url: Path name or file name of a file in the flash memory.
Description
Use the undelete command to restore a deleted file from the recycle bin.
If the name of the file to be restored is the same as that of an existing file, the system prompts you for the confirmation to overwrite the latter.
Examples
# Restore the deleted file named startup.cfg.
Directory of unit1>flash:/
1 -rw- 1443 Apr 02 2000 02:45:13 [startup.cfg]
2 -rwh 151 Apr 02 2000 00:05:53 private-data.txt
3 (*) -rw- 1713 Apr 01 2000 23:57:11 vrpcfg.cfg
4 -rwh 356 Apr 02 2000 03:20:25 dsakey
5 -rwh 428 Apr 02 2000 03:21:59 hostkey
6 -rwh 572 Apr 02 2000 03:22:21 serverkey
6858 KB total (6846 KB free)
(*) -with main attribute (b) -with backup attribute
(*b) -with both main and backup attribute
<device>undelete startup.cfg
Undelete unit1>flash:/startup.cfg?[Y/N]:y
...
%Undeleted file unit1>flash:/startup.cfg.
File Attribute Configuration Commands
boot attribute-switch
Syntax
boot attribute-switch { all | configuration | web }
View
User view
Parameters
all: Specifies all the files, including app files, configuration files and Web files.
configuration: Specifies configuration files.
web: Specifies Web files.
Description
Use the boot attribute-switch command to switch between the main and backup attribute for all the files or a specified type of files. That is, change a file with the main attribute to one with the backup attribute, or vice versa.
Examples
# Switch the attributes of all the files.
<device> boot attribute-switch all
The web and configuration file's backup-attribute and main-attribute will exchange.
Are you sure? [Y/N] y
The web and configuration file's backup-attribute and main-attribute successfully exchanged on unit 1!
boot web-package
Syntax
boot web-package webfile { backup | main }
View
User view
Parameters
webfile: Name of a Web file, a string comprising 5 to 127 characters.
main: Specifies the file to be with the main attribute.
backup: Specifies the file to be with the backup attribute.
Description
Use the boot web-package command to configure a Web file in the device to be with the main or backup attribute.
l Before configuring the main or backup attribute for a Web file, make sure the file exists on the devices.
l The configuration of the main or backup attribute for a Web file takes effect immediately without restarting the device.
l After you upgrade a Web file, you need to specify the new Web file in the Boot menu after restarting the device or specify a new Web file by using the boot web-package command. Otherwise, the Web server cannot function normally.
Examples
# Configure the Web file named boot.web to be with the main attribute.
<device> boot web-package boot.web main
display web package
Syntax
display web package
View
Any view
Parameters
None
Description
Use the display web package command to display information about the Web file used by the device, including the name of the currently used Web file, and the name of the Web files with the main and backup attributes used for next startup.
Examples
# Display information about the Web file used by the device.
<device> display web package
The current using web package is: flash:/H3C-http3.1.8-0015.web
The main web package is: flash:/ H3C-http3.1.8-0015.web
The backup web package is:NULL