- Table of Contents
-
- H3C S9500 Command Manual-Release1648[v1.24]-08 System Volume
- 00-1Cover
- 01-Command Line Interface Commands
- 02-Login and User Interface Commands
- 03-FTP and TFTP Commands
- 04-HA Commands
- 05-NQA Commands
- 06-NetStream Commands
- 07-NTP Commands
- 08-RMON Commands
- 09-SNMP Commands
- 10-Packet Statistics Accounting Commands
- 11-Device Management Commands
- 12-Configuration File Management Commands
- 13-File System Management Commands
- 14-Cluster Management Commands
- 15-System Maintenance and Debugging Commands
- 16-Information Center Commands
- 17-PoE Commands
- 18-Clock Module Commands
- 19-ACSEI Server Commands
- 20-OAP Module Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
13-File System Management Commands | 59.15 KB |
Chapter 1 File System Management Commands
1.1 File System
& Note:
The limitations on the names of directories and files on switch are as follows:
l It is recommended that the name of a directory or file should not contain more than 56 characters; otherwise you will not be able to delete such a directory or file, even though the system supports directory or file names containing more than 64 characters.
l The total number of characters including device, single directory and file names can be up to 136 characters long.
1.1.1 cd
Syntax
cd directory
View
User view
Parameters
directory: Destination directory. By default, the directory is the active path configured by the user when the system starts.
Description
Use the cd command to change the current path on the Switch.
The default directory is the one set up at startup..
Examples
# Change the current directory of the switch to flash.
<H3C> cd flash:
<H3C> pwd
flash:
1.1.2 copy
Syntax
copy fileurl-source fileurl-dest
View
User view
Parameters
fileurl-source: Source file name.
fileurl-dest: Destination file name.
Description
Use the copy command to copy a file.
You can use this command to copy a file from current directory to another directory, or vise versa. Where, the source filename must be the name of a file that has already existed in the specified directory, and the destination filename can be changed as required. When the destination filename is the same as that of an existing file, the system will ask whether to overwrite it.
Examples
# Copy file flash:/manuinfo.txt and saves it as flash:/manuinfo.bak.
<H3C> copy flash:/manuinfo.txt flash:/manuinfo.bak
Copy flash:/manuinfo.txt to flash:/manuinfo.bak?[Y/N]:y
100% complete
Copy file flash:/manuinfo.txt to flash:/manuinfo.bak...Done.
1.1.3 delete
Syntax
delete [ /unreserved ] file-url
View
User view
Parameters
/unreserved: Delete the file completely.
file-url: Path and name of the file you want to delete.
Description
Use the delete command to cancel a specified file from the storage device of the switch.
This command supports wildcard characters. The deleted files are kept in the recycle bin and will not be displayed when you use the dir command. However you can use the dir /all command to display them. The files deleted by the delete command can be recovered by the undelete command or deleted permanently from the recycle bin by the reset recycle-bin command.
Note that, if two files with the same name in a directory are deleted, only the latest deleted file will be kept in the recycle bin.
Examples
# Delete file flash:/manuinfo.bak.
<H3C> delete flash:/manuinfo.bak
Delete flash:/manuinfo.bak?[Y/N]:y
Deleted file flash:/manuinfo.bak.
1.1.4 dir
Syntax
dir [ /all ] [ file-url ]
View
User view
Parameters
/all: Display all the files (including the deleted ones).
file-url: File or directory name to be displayed. The file-url argument supports the wild card“*”. For example, using dir *.txt will display all the files with the extension txt in the current directory.
Description
Use the dir command to view the information about the specified file or directory in the storage device of the switch.
Examples
# Display information about file flash:/test/test.txt
<H3C> dir flash:/test/test.txt
Directory of flash:/test/
0 -rw- 1 noone nogroup 971 Sep 20 2003 14:28:52 test.txt
7747 KB total (4850 KB free)
# Display the information about all the files (including the deleted ones) in the flash:/test/ directory.
<H3C> dir /all flash:/test/
Directory of flash:/test/
-rwxrwxrwx 1 noone nogroup 971 Sep 20 2003 14:28:52 test.txt
1 -rw- 4 Apr 04 2005 20:13:47 [snmpboots]
31877 KB total (2182 KB free)
The files that have already been deleted and kept in the recycle bin are displayed with the square brackets [ ].
# Display the information about all the files (including the deleted ones) in the flash:/test/ directory whose names start with the t character.
<H3C> dir /all flash:/test/t*
Directory of flash:/test/
0 -rw- 1 noone nogroup 971 Sep 20 2003 14:28:52 test.txt
7747 KB total (4850 KB free)
1.1.5 execute
Syntax
execute filename
View
System view
Parameters
filename: Name of the batch file, ranging from 1 to 256.
Description
Use the execute command to execute the specified batch file.
The batch command executes the command lines in the batch file one by one. There should be no invisible character in the batch file. If invisible characters are found, the batch command will quit the current execution without back off operation. The batch command does not guarantee the execution of each command, nor does it perform hot backup itself. The forms and contents of the commands are not restricted in the batch file.
Examples
# Execute the batch file test.bat in the directory flash:/.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] execute test.bat
1.1.6 fdisk
Syntax
fdisk device
View
User view
Parameters
device: Name of the device to be partitioned. Now, the Switch only supports the partitioning of CF cards. A device is automatically divided into two partitions with equal size: Partition 1 is named “cf:” and Partition 2 is named “log:”.
Description
Use the fdisk command to partition a device.
Caution:
Do not save the system startup file and configuration file in Partition 2. The system cannot be started from Partition 2.
Examples
# Partition the CF card on the SRPU.
<H3C> fdisk cf:
All data on the device will be lost, continue? [Y/N]: y
Partition 1: 124926 KB Partition 2: 124910 KB
Done.
& Note:
The displayed information of the fdisk command varies with the CF card.
1.1.7 file prompt
Syntax
file prompt { alert | quiet }
View
System view
Parameters
alert: Performs interactive confirmation on dangerous file operations.
quiet: Does not prompt for the file operations.
Description
Use the file prompt command to change the prompt modes of the file operation on the switch.
By default, the prompt mode of the file operation is alert, which performs interactive confirmation on dangerous file operations.
If the prompt mode is set as quiet, that is, no prompt for file operations, some non-recoverable operations may lead to system damage.
Examples
# Configure the prompt mode of file operation as quiet.
<H3C> system-view
System View: return to User View with Ctrl+Z.
[H3C] file prompt quiet
1.1.8 fixdisk
Syntax
fixdisk device
View
User view
Parameters
device: Device name.
Description
Use the fixdisk command to restore the space of a storage device.
Some of the space of a storage device may be unavailable for some reason (such as abnormal operations). In this case, you can use this command to restore the space.
Currently, the switch does not support this command on the compact flash (CF) card.
Examples
# Restore the space of the storage device Flash.
<H3C> fixdisk flash:
1.1.9 format
Syntax
format filesystem
View
User view
Parameters
filesystem: Device name.
Description
Use the format command to format the storage device.
Format operation will cause non-recoverable loss of all the files on the device. Specially, configuration files will be lost after formatting the flash memory.
Examples
# Format Flash.
<H3C> format flash:
All data on flash: will be lost, proceed with format? [Y/N]:y
\
Format flash: completed.
1.1.10 mkdir
Syntax
mkdir directory
View
User view
Parameters
directory: Directory name.
Description
Use the mkdir command to create directory in the specified directory on the storage device.
The directory to be created cannot have the same name as that of other directory or file in the specified directory.
Examples
# Create the directory dd.
<H3C> mkdir dd
Created dir flash:/dd
1.1.11 more
Syntax
more file-url
View
User view
Parameters
file-url: File name.
Description
Use the more command to view the contents of a specific file.
At present, the file system can display files in text format. This command can be used to display the contents of the files with .txt suffix or .cfg (configuration) suffix.
Examples
# Display the contents of file test.txt.
<H3C> more 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.
1.1.12 move
Syntax
move fileurl-source fileurl-dest
View
User view
Parameters
fileurl-source: Source file name.
fileurl-dest: Destination file name.
Description
Use the move command to move files.
When the destination filename is the same as that of an existing file, the system will ask whether to overwrite it.
Examples
# Move flash:/test/sample.txt to flash:/sample.txt.
<H3C> move flash:/test/sample.txt flash:/sample.txt
Move flash:/test/sample.txt to flash:/sample.txt ?[Y/N]:y
Moved file flash:/test/sample.txt to flash:/sample.txt.
& Note:
The switch has the following limitations on directory name and filename:
l The maximum length of a directory name or filename is 56 characters.
l The maximum length of a full-path filename (including the device name, directory name, and filename) is 136 characters.
l The move command can be successfully executed only when the source file and the destination file are on the same device.
1.1.13 pwd
Syntax
pwd
View
User view
Parameters
None
Description
Use the pwd command to view the current path.
Error may occur if the path to be displayed does not exist.
Examples
# Display the current path.
<H3C> pwd
flash:
1.1.14 rename
Syntax
rename fileurl-source fileurl-dest
View
User view
Parameters
fileurl-source: Source file name.
fileurl-dest: Destination file name.
Description
Use the rename command to rename a file.
If the destination file name is identical with that of an already existent directory or file, the rename operation fails and the system prompts that name has already been used or the file is being used.
Examples
# Rename the file sample.txt to sample.bak.
<H3C> rename sample.txt sample.bak
Rename flash:/sample.txt to flash:/sample.bak ?[Y/N]:y
Renamed file flash:/sample.txt to flash:/sample.bak.
1.1.15 reset recycle-bin
Syntax
reset recycle-bin [ file-url ]
View
User view
Parameters
file-url: Name of the file to be deleted.
Description
Use the reset recycle-bin command to permanently delete files from the recycle bin.
The file-url supports the wildcard character "*”.The delete command only puts the file into the recycle bin, but reset recycle-bin command will delete this file permanently.
Examples
# Delete the file from the recycle bin.
<H3C> reset recycle-bin flash:/ config.vrrp
Squeeze flash:/ vrpcgf.vrrp ? [Y/N]:y
Clear files from flash may take a long time.Please wait…Done.
Cleared file flash:/config.vrrp
1.1.16 rmdir
Syntax
rmdir directory
View
User view
Parameters
directory: Directory name.
Description
Use the rmdir command to cancel a directory.
The directory to be deleted must be empty, that is, all the files under the directory should be removed first.
& Note:
When you delete a directory using the rmdir command, the files that belonged to this directory, but are now in the Recycle Bin, will also be deleted.
Examples
# Delete the directory test.
<H3C> rmdir test
Rmdir flash:/test?[Y/N]:y
Removed directory flash:/test
1.1.17 umount
Syntax
umount device
View
User view
Parameters
device: Device name. Now, it can only be CF.
Description
Use the umount command to remove the CF card from the file system.
Examples
# Remove the CF card from the file system.
<H3C> umount cf:
Umount cf: succeed.
1.1.18 undelete
Syntax
undelete file-url
View
User view
Parameters
file-url: Name of the file to be recovered.
Description
Use the undelete command to recover the file that has not been deleted completely.
The file name to be recovered cannot be the same as an existing directory name. If the destination file name is the same as an existing file name, the system will ask you whether to overwrite it.
Examples
# Recover the deleted file sample.bak.
<H3C> undelete sample.bak
Undelete flash:/sample.bak ?[Y/N]:y
Undeleted file flash:/sample.bak.