04-File System Management Commands
Chapters Download (135.45 KB)
Table of Contents
1 File System Management Commands
File System Management Commands
display nandflash file-location
display nandflash badblock-location
2 Configuration File Management Commands
Configuration File Management Commands
archive configuration interval
archive configuration location
l The storage medium type available with your device can be flash, CF card, or some other types depending on your device model.
l For the qualified filename formats, refer to File System Management Configuration in the System Volume.
Syntax
cd { directory | .. | / }
View
User view
Default Level
3: Manage level
Parameters
directory: Name of the target directory, in the format of [drive:/]path. For the detailed introduction to the drive and path arguments, refer to File System Management Configuration in the System Volume. If no drive information is provided, the argument represents a folder or subfolder under the current directory.
..: Returns to an upper directory. If the current working directory is the root directory, or no upper directory exists, the current working directory does not change when the cd .. command is executed. This argument does not support command online help.
/: Returns to the root directory of the storage medium. The keyword does not support command line online help.
Description
Use the cd command to change the current working directory.
Examples
# Enter the test folder after logging in to the device.
<Sysname> cd test
# Return to the upper directory (Remember to enter a space after the keyword cd).
<Sysname> cd ..
# Return to the root directory.
<Sysname> cd /
After you change the current directory using the cd command, you can use the pwd command to view the path of the current working directory.
Syntax
copy fileurl-source fileurl-dest
View
User view
Default Level
3: Manage level
Parameters
fileurl-source: Name of the source file.
fileurl-dest: Name of the target file or folder.
Description
Use the copy command to copy a file.
If you specify a target folder, the system will copy the file to the specified folder and use the name of the source file as the file name.
Examples
# Copy file testcfg.cfg under the current folder and save it as testbackup.cfg.
<Sysname> copy testcfg.cfg testbackup.cfg
Copy flash:/test.cfg to flash:/testbackup.cfg?[Y/N]:y
....
%Copy file flash:/test.cfg to flash:/testbackup.cfg...Done.
Syntax
delete [ /unreserved ] file-url
View
User view
Default Level
3: Manage level
Parameters
/unreserved: Permanently deletes the specified file, and the deleted file can never be restored.
file-url: Name of the file to be deleted. Asterisks (*) are acceptable as wildcards. For example, to remove files with the extension of .txt in the current directory, you may use the delete *.txt command.
Description
Use the delete command to move a specified file from a storage medium to the recycle bin, where you can restore the file with the undelete command or permanently delete it with the reset recycle-bin command.
The dir /all command can display the files moved to the recycle bin. These files are enclosed in pairs of brackets.
If you delete two files in different directories but with the same filename, only the last one is retained in the recycle bin.
Examples
# Remove file tt.cfg from the current directory.
<Sysname> delete tt.cfg
Delete flash:/tt.cfg? [Y/N]:y
.
%Delete file flash:/tt.cfg...Done.
Syntax
dir [ /all ] [ file-url ]
View
User view
Default Level
3: Manage level
Parameters
/all: Displays all files.
file-url: Name of the file or directory to be displayed. Asterisks (*) are acceptable as wildcards. For example, to display files with the .txt extension under the current directory, you may use the dir *.txt command.
Description
Use the dir command to display information about all visible files and folders in the current directory.
Use the dir /all command to display information about all files and folders in the current directory, including hidden files, hidden sub-folders and the files in the recycle bin that originally belong to the current directory. The names of these deleted files are enclosed in pairs of brackets [ ].
The dir file-url command displays information about a file or folder.
Examples
# Display information about all files and folders.
<Sysname> dir /all
Directory of flash:/
0 drw- 6985954 Apr 26 2007 21:06:29 logfile
1 -rw- 1842 Apr 27 2007 04:37:17 mainup.bin
2 -rw- 1518 Apr 26 2007 12:05:38 config.cfg
3 -rw- 2045 May 04 2007 15:50:01 backcfg.cfg
4 -rwh 428 Apr 27 2007 16:41:21 hostkey
5 -rwh 572 Apr 27 2007 16:41:31 serverkey
6 -rw- 2737556 Oct 12 2007 01:31:44 [old.bin]
515712 KB total (5096 KB free)
[ ] indicates this file is in the recycle bin.
Table 1-1 dir command output description
Field |
Description |
Directory of |
The current working directory |
d |
Indicates a directory; if this field does not exist, it indicates a file. |
r |
Indicates that the file or directory is readable. |
w |
Indicates that the file or directory is writable. |
h |
Indicates that the file or directory is hidden. |
[ ] |
Indicates that the file is in the recycle bin. |
Syntax
display nandflash file-location filename
View
Any view
Default Level
2: System level
Parameters
filename: File name.
Description
Use the display nandflash file-location command to display the location of the specified file in the NAND flash memory.
The displayed information includes all the physical pages corresponding to the logical pages of the specified file.
Examples
# Display the location of the file test.cfg in the NAND flash memory.
<Sysname> display nandflash file-location test.cfg
Logical Chunk Physical Page
---------------------------
chunk(0) 1234
chunk(1) 1236
chunk(2) 1235
filename: test.cfg
Table 1-2 display nandflash file-location command output description
Field |
Description |
Logic Chunk |
Serial number of the logical pages |
Physical Page |
Serial number of the physical pages |
chunk(0) 1234 |
The first logical page of this file corresponds to the 1234th physical page on the device. |
Syntax
display nandflash badblock-location
View
Any view
Default Level
2: System level
Parameters
None
Description
Use the display nandflash badblock-location command to display the number and location of bad blocks in the NAND flash memory.
Examples
# Display the number and location of bad blocks in the NAND flash memory.
<Sysname> display nandflash badblock-location
No Physical block
------------------------------
badblock(0) 1234
badblock(1) 1235
badblock(2) 1236
3200 block(s) total, 3 block(s) bad.
Table 1-3 display nandflash badblock-location command output description
Field |
Description |
No |
Serial number of the bad blocks |
Physical block |
Serial number of the physical pages on which there are bad blocks |
3200 block(s) total, 3 block(s) bad. |
Total number of blocks and bad blocks in the NAND flash memory |
Syntax
display nandflash page-data page-value
View
Any view
Default Level
1: Monitor level
Parameters
page-value: Serial number of a physical page.
Description
Use the display nandflash page-data command to display the data on the specified physical page in the NAND flash memory.
This command is always used in combination with the display nandflash file-location command to check the correctness of the data in the NAND flash memory.
Examples
# Display the content of the file test.cfg which is saved in the NAND flash memory.
<Sysname> display nandflash file-location test.cfg
Logical Chunk Physical Page
---------------------------
chunk(0) 1234
chunk(1) 1236
chunk(2) 1235
filename: test.cfg
<Sysname> display nandflash page-data 1236
0000: 0D 0A 23 0D 0A 20 76 65 72 73 69 6F 6E 20 35 2E ..#.. version 5.
0010: 32 30 2C 20 41 6C 70 68 61 20 31 30 31 31 0D 0A 20, Alpha 1011..
0020: 23 0D 0A 20 73 79 73 6E 61 6D 65 20 48 33 43 0D #.. sysname H3C.
0030: 0A 23 0D 0A 20 70 61 73 73 77 6F 72 64 2D 63 6F .#.. password-co
...Omitted...
Syntax
execute filename
View
System view
Default Level
2: System level
Parameters
filename: Name of a batch file with a .bat extension. You can use the rename command to change the suffix of the configuration file to .bat to use it as a batch file.
Description
Use the execute command to execute the specified batch file.
Batch files are command line files. Executing a batch file is to execute a set of command lines in the file.
l You should not include invisible characters in a batch file. If an invisible character is found during the execution, the batch process will abort and the commands that have been executed cannot be cancelled.
l Not every command in a batch file is sure to be executed. For example, if a certain command is not correctly configured, the system omits this command and goes to the next one.
l The configuration generated after a batch file is executed will not be backed up to the standby main board automatically.
l Each configuration command in a batch file must be a standard configuration command, meaning that the valid configuration information can be displayed with the display current-configuration command after this command is configured successfully; otherwise, this command may not be executed correctly.
Examples
# Execute the batch file test.bat in the root directory.
<Sysname> system-view
[Sysname] execute test.bat
Syntax
file prompt { alert | quiet }
View
System view
Default Level
3: Manage level
Parameters
alert: Enables the system to warn you about operations that may bring undesirable results such as file corruption or data loss.
quiet: Disables the system from warning you about any operation.
Description
Use the file prompt command to set a prompt mode for file operations.
By default, the prompt mode is alert.
Note that when the prompt mode is set to quiet, the system does not warn for any file operation. To avoid undesirable consequences resulting from misoperation, you are recommended to use the alert mode.
Examples
# Set the file operation prompt mode to alert.
<Sysname> system-view
[Sysname] file prompt alert
Syntax
fixdisk device
View
User view
Default Level
3: Manage level
Parameters
device: Storage medium name.
Description
Use the fixdisk command to restore the space of a storage medium when it becomes unavailable because of some abnormal operation.
Examples
# Restore the space of the flash. (The output information of the command depends on the device model)
<Sysname> fixdisk flash:
Fixdisk flash: may take some time to complete...
%Fixdisk flash: completed.
Syntax
format device
View
User view
Default Level
3: Manage level
Parameters
device: Name of a storage medium.
Description
Use the format command to format a storage medium.
Formatting a storage medium results in loss of all the files on the storage medium and these files cannot be restored. In particular, if there is a startup configuration file on a storage medium, formatting the storage medium results in loss of the startup configuration file.
Examples
# Format the flash.
<Sysname> format flash:
All data on flash: will be lost, proceed with format? [Y/N]:y
./
%Format flash: completed.
Syntax
mkdir directory
View
User view
Default Level
3: Manage level
Parameters
directory: Name of a folder.
Description
Use the mkdir command to create a folder under a specified directory on the storage medium.
Note that:
l The name of the folder to be created must be unique under the specified directory. Otherwise, you will fail to create the folder under the directory.
l To use this command to create a folder, the specified directory must exist. For instance, to create folder flash:/test/mytest, the test folder must exist. Otherwise, you will fail to create folder mytest.
Examples
# Create a folder named test under the current directory.
<Sysname> mkdir test
....
%Created dir flash:/test
# Create folder test/subtest under the current directory.
<Sysname> mkdir test/subtest
....
%Created dir flash:/test/subtest
Syntax
more file-url
View
User view
Default Level
3: Manage level
Parameters
file-url: File name.
Description
Use the more command to display the contents of the specified file.
So far, this command is valid only for text files.
Examples
# Display the contents of file test.txt.
<Sysname> more test.txt
Welcome to H3C.
# Display the contents of file testcfg.cfg.
<Sysname> more testcfg.cfg
#
version 5.20, Beta 1201, Standard
#
sysname Sysname
#
vlan 2
#
return
<Sysname>
Syntax
move fileurl-source fileurl-dest
View
User view
Default Level
3: Manage level
Parameters
fileurl-source: Name of the source file.
fileurl-dest: Name of the target file or folder.
Description
Use the move command to move a file.
If you specify a target folder, the system will move the source file to the specified folder, with the file name unchanged.
Examples
# Move file flash:/test/sample.txt to flash:/, and save it as 1.txt.
<Sysname> move test/sample.txt 1.txt
Move flash:/test/sample.txt to flash:/1.txt?[Y/N]:y
...
% Moved file flash:/test/sample.txt to flash:/1.txt
# Move file b.cfg to the subfolder test2.
<Sysname> move b.cfg test2
Move flash:/b.cfg to flash:/test2/b.cfg?[Y/N]:y
.
%Moved file flash:/b.cfg to flash:/test2/b.cfg.
Syntax
pwd
View
User view
Default Level
3: Manage level
Parameters
None
Description
Use the pwd command to display the current path.
Examples
# Display the current path.
<Sysname> pwd
flash:
Syntax
rename fileurl-source fileurl-dest
View
User view
Default Level
3: Manage level
Parameters
fileurl-source: Name of the source file or folder.
fileurl-dest: Name of the target file or folder.
Description
Use the rename command to rename a file or folder.
The target file name must be unique under the current path.
Examples
# Rename file sample.txt as sample.bat.
<Sysname> rename sample.txt sample.bat
Rename flash:/sample.txt to flash:/sample.bat? [Y/N]:y
% Renamed file flash:/sample.txt to flash:/sample.bat
Syntax
reset recycle-bin [ /force ]
View
User view
Default Level
3: Manage level
Parameters
/force: Deletes all files in the recycle bin, including files that cannot be deleted by the command without the /force keyword.
Description
Use the reset recycle-bin command to permanently delete the files in the recycle bin in the current directory.
If a file is corrupted, you may not be able to delete the file using the reset recycle-bin command. In this case, you can use the reset recycle-bin /force command, which can delete all the files in the recycle bin forcibly.
Note that:
l Unlike this command, the delete file-url command only moves a file to the recycle bin, and the file still occupies the memory space. To delete the file in the recycle bin, you need to execute the reset recycle-bin command in the original directory of the file.
l The reset recycle-bin command deletes files in the current directory and in the recycle bin. If the original path of the file to be deleted is not the current directory, use the cd command to enter the original directory of the file, and then execute the reset recycle-bin command.
Examples
# Delete file b.cfg under the current directory and in the recycle bin.
l Display all the files in the recycle bin and under the current directory.
<Sysname> dir /all
Directory of flash:/
0 -rwh 3080 Apr 26 2008 16:41:43 private-data.txt
1 -rw- 2416 Apr 26 2008 13:45:36 config.cfg
2 -rw- 8036197 May 14 2008 10:13:18 main.bin
3 -rw- 2386 Apr 26 2008 13:30:30 back.cfg
4 drw- - May 08 2008 09:49:25 test
5 -rwh 716 Apr 24 2007 16:17:30 hostkey
6 -rwh 572 Apr 24 2007 16:17:44 serverkey
7 -rw- 2386 May 08 2008 11:14:20 [a.cfg]
8 -rw- 3608 Dec 03 2007 17:29:30 [b.cfg]
515712 KB total (6730 KB free)
//The above information indicates that the current directory is flash:, and there are two files a.cfg and b.cfg in the recycle bin.
l Delete file b.cfg under the current directory and in the recycle bin.
<Sysname> reset recycle-bin
Clear flash:/~/a.cfg ?[Y/N]:n
Clear flash:/~/b.cfg ?[Y/N]:y
Clearing files from flash may take a long time. Please wait...
......
%Cleared file flash:/~/b.cfg...
l In directory flash:, check whether the file b.cfg in the recycle bin is deleted.
<Sysname> dir /all
Directory of flash:/
0 -rwh 3080 Apr 26 2008 16:41:43 private-data.txt
1 -rw- 2416 Apr 26 2008 13:45:36 config.cfg
2 -rw- 8036197 May 14 2008 10:13:18 main.bin
3 -rw- 2386 Apr 26 2008 13:30:30 back.cfg
4 drw- - May 08 2008 09:49:25 test
5 -rwh 716 Apr 24 2007 16:17:30 hostkey
6 -rwh 572 Apr 24 2007 16:17:44 serverkey
7 -rw- 2386 May 08 2008 11:14:20 [a.cfg]
515712 KB total (6734 KB free)
// The above information indicates that file flash:/b.cfg is deleted permanently.
# Delete file aa.cfg in the subdirectory test and in the recycle bin.
l Enter the subdirectory
<Sysname> cd test/
l Check all the files in the subfolder test.
<Sysname> dir /all
Directory of flash:/test
0 -rw- 2161 Apr 26 2000 21:22:35 [aa.cfg]
515712 KB total (6734 KB free)
// The above information indicates only one file exists in the folder, and the file has been moved to the recycle bin.
l Permanently delete file test/aa.cfg.
<Sysname> reset recycle-bin
Clear flash:/test/~/aa.cfg ?[Y/N]:y
Clearing files from flash may take a long time. Please wait...
..
%Cleared file flash:/test/~/aa.cfg...
Syntax
rmdir directory
View
User view
Default Level
3: Manage level
Parameters
directory: Name of the folder.
Description
Use the rmdir command to remove a folder.
l The folder must be an empty one. If not, you need to delete all files and subfolders under it with the delete command.
l After you execute the rmdir command successfully, the files in the recycle bin under the folder will be automatically deleted.
Examples
# Remove folder mydir.
<Sysname> rmdir mydir
Rmdir flash:/mydir?[Y/N]:y
%Removed directory flash:/mydir.
Syntax
undelete file-url
View
User view
Default Level
3: Manage level
Parameters
file-url: Name of the file to be restored.
Description
Use the undelete command to restore a file from the recycle bin.
If another file with the same name exists under the same path, the undelete operation will cause it to be overwritten and the system will prompt you whether to continue.
Examples
# Restore file a.cfg in directory flash: from the recycle bin.
<Sysname> undelete a.cfg
Undelete flash:/a.cfg?[Y/N]:y
.....
%Undeleted file flash:/a.cfg.
# Restore file b.cfg in directory flash:/test from the recycle bin.
<Sysname> undelete flash:/test/b.cfg
Undelete flash:/test/b.cfg?[Y/N]:y
.......
%Undeleted file flash:/test/b.cfg.
Or, you can use the following steps to restore file flash:/test/b.cfg.
<Sysname> cd test
<Sysname> undelete b.cfg
Undelete flash:/test/b.cfg?[Y/N]:y
.....
%Undeleted file flash:/test/b.cfg.
Syntax
archive configuration
View
User view
Default Level
3: Manage level
Parameters
None
Description
Use the archive configuration command to save the current running configuration manually.
After the execution of this command, the system saves the current running configuration with the specified filename (filename prefix + serial number) to the specified path.
Note that before executing the archive configuration command, you must configure the filename prefix and path of the saved configuration file by using the archive configuration location command.
Examples
# Save the current running configuration manually.
<Sysname> archive configuration
Warning: Save the running configuration to an archive file. Continue? [Y/N]: Y
Please wait...
Info: The archive configuration file myarchive_1.cfg is saved.
Syntax
archive configuration interval minutes
undo archive configuration interval
View
System view
Default Level
3: Manage level
Parameters
minutes: Specifies the interval for automatically saving the current running configuration, in minutes. The value ranges from 10 to 525,600 (365 days).
Description
Use the archive configuration interval command to enable the automatic saving of the current running configuration and set the interval.
Use the undo archive configuration interval command to restore the default.
By default, the system does not save the current running configuration automatically.
After the execution of this command, the system saves the current running configuration with the specified filename to the specified path at a specified interval (the value of the minutes argument).
Configure an automatic saving interval according to the storage medium performance and the frequency of configuration modification:
l If the configuration of the device does not change frequently, you are recommended to save the current running configuration manually as needed
l Because the S5810 uses a low-speed storage medium, you are recommended either to save the current running configuration manually, or to configure automatic saving with an interval longer than 1,440 minutes (24 hours).
Note that: before executing the archive configuration interval command, you must configure the filename prefix and path of the saved configuration file by using the archive configuration location command.
Examples
# Configure the system to save the current running configuration every 60 minutes.
<Sysname> system-view
[Sysname] archive configuraion interval 60
Info: Archive files will be saved every 60 minutes.
Syntax
archive configuration location directory filename-prefix filename-prefix
undo archive configuration location
View
System view
Default Level
3: Manage level
Parameters
directory: The path of the folder for saving the saved configuration file, a case insensitive string of 1 to 63 characters, in the format of storage medium name:/[folder name]/subfolder name. The folder must be created before the configuration.
filename-prefix: The filename prefix of a saved configuration file, a case insensitive string of 1 to 30 characters (can include letters, numbers, _, and - only).
Description
Use the archive configuration location command to configure the path and filename prefix of a saved configuration file.
Use the undo archive configuration location command to restore the default.
By default, the path and filename prefix of a saved configuration file are not configured, and the system does not save the configuration file periodically.
Note the following:
l Before the current running configuration is saved either manually or automatically, the file path and filename prefix must be configured.
l If the undo archive configuration location command is executed, the current running configuration can neither be saved manually nor automatically, and the configuration by executing the archive configuration interval and archive configuration max commands restores to the default, meanwhile, the saved configuration files are cleared.
Examples
# Configure the path and the filename prefix of a saved configuration file as flash:/archive/ and my_archive respectively.
<Sysname> mkdir archive
.
%Created dir flash:/archive.
<Sysname> system-view
[Sysname] archive configuration location flash:/archive filename-prefix my_archive
Syntax
archive configuration max file-number
undo archive configuration max
View
System view
Default Level
3: Manage level
Parameters
file-number: The maximum number of configuration files that can be saved, in the range 1 to 10. The value of the file-number argument is determined by the memory space. You are recommended to set a comparatively small value for this argument if the available memory space is small.
Description
Use the archive configuration max command to set the maximum number of configuration files that can be saved.
Use the undo archive configuration max command to restore the default.
By default, a maximum of 5 configuration files can be saved.
Since excessive configuration files occupy large memory space, you can use this command to control the number of the files. After the maximum number of configuration files is saved, the system deletes the oldest files when the next file is saved (either automatically or manually). When you change the maximum number of configuration files that can be saved, the exceeded files are not deleted. If the number of the existing configuration files is larger than or equal to the newly configured upper limit, the system deletes the oldest n files when the next file is saved, where n = the current number - the newly configured number + 1, for example: if the number of configuration files that have been saved is 7, and the newly configured upper limit is 4, when there is a new configuration file to be saved, the system deletes 4 oldest files, where 4 = 7-4+1.
Before executing this command, configure the path and filename prefix of a saved configuration file by using the archive configuration location command; otherwise, the execution of this command fails.
Note that, if the undo archive configuration location command is executed, the maximum number of configuration files that can be saved also restores to the default.
Examples
# Set the maximum number of configuration files that can be saved to 10.
<Sysname> system-view
[Sysname] archive configuration max 10
Syntax
backup startup-configuration to dest-addr [ dest-filename ]
View
User view
Default Level
2: System level
Parameters
dest-addr: IP address or name of a TFTP server.
dest-filename: Target filename used to save the startup configuration file for the next system startup on the server.
Description
Use the backup startup-configuration command to back up the startup configuration file (used at the next system startup) to a specified TFTP server. If you do not specify this filename, the original filename is used.
This command only backs up the main startup configuration file.
Presently, the device uses TFTP to back up configuration files.
Examples
# Back up the startup configuration file of the device to the TFTP server with IP address 2.2.2.2, using filename 192-168-1-26.cfg.
<Sysname> display startup
Current startup saved-configuration file: flash:/config.cfg
Next startup saved-configuration file: flash:/test.cfg
<Sysname> backup startup-configuration to 2.2.2.2 192-168-1-26.cfg
Backup next startup-configuration file to 2.2.2.2, please wait…finished!
<Sysname>
After the above operation, the device backs up file test.cfg to TFTP server 2.2.2.2, where the file is saved as 192-168-1-26.cfg.
Syntax
configuration replace file filename
View
System view
Default Level
3: Manage level
Parameters
filename: Specifies the name of the replacement configuration file for configuration rollback.
Description
Use the configuration replace file command to set configuration rollback.
After the execution of this command, the current running configuration rolls back to the configuration state based on the specified configuration file (filename).
Examples
# Roll back from the current running configuration to a previous configuration state based on a saved configuration file my_archive_1.cfg.
<Sysname> system-view
[Sysname] configuration replace file my_archive_1.cfg
Info: Now replacing the current configuration. Please wait...
Info: Succeeded in replacing current configuration with the file my_archive_1.cfg.
Syntax
display archive configuration
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display archive configuration command to display the information about configuration rollback.
Examples
# Display the information about configuration rollback.
<Sysname> display archive configuration
Location: flash:/archive
Filename prefix: my_archive
Archive interval in minutes: 120
Maximum number of archive files: 10
Saved archive files:
No. TimeStamp FileName
1 Aug 05 2007 20:24:54 my_archive_1.cfg
2 Aug 05 2007 20:34:54 my_archive_2.cfg
# 3 Aug 05 2007 20:44:54 my_archive_3.cfg
‘#’ indicates the most recent archive file.
Next archive file to be saved: my_archive_4.cfg
Table 2-1 display archive configuration command output description
Field |
Description |
Location |
Absolute path of the saved configuration files |
Archive interval in minutes |
Configuration file saving interval, in minutes. If the automatic saving is disabled, this field is not displayed. |
Syntax
display saved-configuration [ by-linenum ]
View
Any view
Default Level
2: System level
Parameters
by-linenum: Identifies each line of displayed information with a line number.
Description
Use the display saved-configuration command to display the contents of the configuration file saved for the next startup of the device.
During device management and maintenance, you can use this command to check whether important configurations are saved to the configuration file to be used for the next startup of the device.
For a device supporting main and backup configuration files, this command displays the main configuration file to be used for the next system startup.
If the system is not specified with a configuration file for the next startup or the specified configuration file does not exist, no information will be displayed when you execute the display saved-configuration command.
Related commands: save, reset saved-configuration; display current-configuration in Basic System Configuration Commands in the System Volume.
Examples
# Display the configuration file saved for the next startup of the device.
<Sysname> display saved-configuration
#
version 5.20, Test 5310
#
sysname Sysname
#
domain default enable system
#
telnet server enable
#
multicast routing-enable
#
vlan 1
#
vlan 999
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
interface NULL0
#
---- More ----
The configurations are displayed in the order of global, port, and user interface. “ ---- More ----” means that all information on this screen has been displayed, and if you press the Space key, the next screen will be displayed.
# Display the contents of the configuration file saved for the next startup of the device with a number identifying each line.
<Sysname> display saved-configuration by-linenum
1: #
2: version 5.20, Test 5310
3: #
4: sysname Sysname
5: #
6: domain default enable system
7: #
8: telnet server enable
9: #
10: multicast routing-enable
11: #
12: vlan 1
13: #
14: vlan 999
15: #
16: domain system
17: access-limit disable
18: state active
19: idle-cut disable
20: self-service-url disable
21: #
22: interface NULL0
23: #
---- More ----
“ ---- More ----” means that all information on this screen has been displayed, and if you press the Space key, the next screen will be displayed.
Syntax
display startup
View
Any view
Default Level
1: Monitor level
Parameters
None
Description
Use the display startup command to display the configuration files used at the current system startup and the configuration file(s) to be used at the next system startup.
Related commands: startup saved-configuration.
Examples
# Display the startup configuration file used at the current system startup and the one to be used at the next system startup.
<Sysname> display startup
Current startup saved-configuration file: flash:/startup.cfg
Next main startup saved-configuration file: flash:/startup.cfg
Next backup startup saved-configuration file: flash:/a.cfg
Table 2-2 display startup command output description
Field |
Description |
Current Startup saved-configuration file |
The configuration file used for the current startup |
Next main startup saved-configuration file |
Main configuration file used for the next startup |
Next backup startup saved-configuration file |
Backup configuration file used for the next startup |
Syntax
reset saved-configuration [ backup | main ]
View
User view
Default Level
2: System level
Parameters
backup: Deletes the backup startup configuration file.
main: Deletes the main startup configuration file.
Description
Use the reset saved-configuration command to delete the startup configuration file saved on the storage medium of the device.
Note that:
l This command will permanently delete the configuration file from the device. Use it with caution.
l On a device that has the main and backup startup configuration files, you can choose to delete either the main or backup startup configuration file. However, in the case that the main and backup startup configuration files are the same, if you perform the delete operation for once, the system will not delete the configuration file but only set the corresponding startup configuration file (main or backup, according to which one you specified in the command) to NULL.
l The execution of the reset saved-configuration command and that of the reset saved-configuration main command have the same effect, that is, they will delete the main startup configuration file.
Related commands: save, display saved-configuration.
Examples
# Delete the configuration file for the next startup from the storage medium of the device.
<Sysname> reset saved-configuration
The saved configuration file will be erased. Are you sure? [Y/N]:y
Configuration file in flash is being cleared.
Please wait ...........
Configuration file is cleared.
Syntax
restore startup-configuration from src-addr src-filename
View
User view
Default Level
2: System level
Parameters
src-addr: IP address or name of a TFTP server.
src-filename: Filename of the configuration file to be downloaded from the specified server.
Description
Use the restore startup-configuration command to download a configuration file from the specified TFTP server to the device and specify the configuration file as the startup configuration file to be used at the next startup of the device.
l The file downloaded is set as the main startup configuration file to be used at the next system startup.
Examples
# Download configuration file test.cfg from the TFTP server whose IP address is 2.2.2.2, and the configuration file is to be used at the next startup of the device.
<Sysname> restore startup-configuration from 2.2.2.2 test.cfg
Restore next startup-configuration file from 2.2.2.2. Please wait..............
finished!
Syntax
save file-url
save [ safely ] [ backup | main ]
View
Any view
Default Level
2: System level
Parameters
file-url: File path, where the extension of the file name must be .cfg.
safely: Sets the configuration saving mode to safe. If this argument is not specified, the configuration file is saved in fast mode.
backup: Saves the current configuration to the startup configuration file specified in the interactive mode, and specifies the file as the backup startup configuration file to be used at the next startup of the device.
main: Saves the current configuration to the main startup configuration file specified in the interactive mode, and specifies the file as the main startup configuration file to be used at the next startup of the device.
Description
Use the save file-url command to save the current configuration to the specified configuration file, but the system will not specify the file as the startup configuration file for the next system startup. If the file specified by file-url does not exist, the system will create the file and then save the configuration to the file.
Use the save [ safely ] [ backup | main ] command to save the current configuration to the root directory of the storage medium, and specify the file as the startup configuration file for the next system startup.
Related commands: reset saved-configuration, display current-configuration, display saved-configuration.
Examples
# Save the current configuration file to the specified directory, but do not specify the configuration file as the configuration file for the next startup.
<Sysname> save test.cfg
The current configuration will be saved to flash:/test.cfg. Continue? [Y/N]:y
Now saving current configuration to the device.
Saving configuration flash:/test.cfg. Please wait...
............
Configuration is saved to flash successfully.
# Save the current configuration file to the root directory of the storage medium, and specify the configuration file as the configuration file for the next startup.
<Sysname> display startup
Current startup saved-configuration file: flash:/hmr.cfg
Next main startup saved-configuration file: flash:/aa.cfg
Next backup startup saved-configuration file: NULL
// The above information indicates that the main startup configuration file for the next system startup is aa.cfg.
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/aa.cfg]
(To leave the existing filename unchanged, press the enter key):startup.cfg
Validating file. Please wait............
Configuration is saved to device successfully.
<Sysname> display startup
Current startup saved-configuration file: flash:/hmr.cfg
Next main startup saved-configuration file: flash:/startup.cfg
Next backup startup saved-configuration file: NULL
// The above information indicates that the main startup configuration file for the next system startup is changed to startup.cfg.
Syntax
startup saved-configuration cfgfile [ backup | main ]
undo startup saved-configuration
View
User view
Default Level
2: System level
Parameters
cfgfile: Configuration file name. The file must be a file with an extension .cfg stored in the root directory of the storage medium.
backup: Sets the configuration file as the backup startup configuration file that will be used at the next startup of the device.
main: Sets the configuration file as the main startup configuration file that will be used at the next startup of the device.
Description
Use the startup saved-configuration command to specify a startup configuration file (the configuration file to be used at the next system startup).
Use the undo startup saved-configuration command to configure the system to start up with the null configuration, that is, the factory configuration.
Notes that:
l The startup saved-configuration and startup saved-configuration main commands have the same effect: Both of them are used to specify the main startup configuration file.
l The main and backup startup configuration files can be specified as the same file. However, it is recommended you use different files, or, save the same configuration as two files using different file names, one specified as the main startup configuration file, and the other specified as the backup.
l If you execute the undo startup saved-configuration command, the system will set the main and backup startup configuration file as NULL, but will not delete the two configuration files.
Related commands: display startup.
Examples
# Specify a startup configuration file for the next system startup.
<Sysname> startup saved-configuration testcfg.cfg
Please wait ....
... Done!