- Table of Contents
-
- H3C WX6103 Access Controller Switch Interface Board Command Reference-6W102
- 00-Preface
- 01-Login Commands
- 02-VLAN Commands
- 03-IP Addressing and IP Performance Commands
- 04-QinQ-BPDU Tunneling Commands
- 05-Port Correlation Commands
- 06-Link Aggregation Commands
- 07-MAC Address Table Management Commands
- 08-Port Security Commands
- 09-MSTP Commands
- 10-IP Routing-GR Overview Commands
- 11-IPv4 Routing Commands
- 12-IP Source Guard Commands
- 13-DLDP Commands
- 14-Multicast Commands
- 15-LLDP Commands
- 16-sFlow Commands
- 17-ARP Commands
- 18-DHCP Commands
- 19-ACL Commands
- 20-QoS Commands
- 21-Port Mirroring Commands
- 22-UDP Helper Commands
- 23-SNMP-RMON Commands
- 24-NTP Commands
- 25-DNS Commands
- 26-File System Management Commands
- 27-Information Center Commands
- 28-System Maintaining and Debugging Commands
- 29-NQA Commands
- 30-SSH Commands
- 31-SSL-HTTPS Commands
- 32-PKI Commands
- 33-Track Commands
- 34-Index
- Related Documents
-
Title | Size | Download |
---|---|---|
26-File System Management Commands | 180.75 KB |
Table of Contents
1 File System Management Commands
File System Configuration Commands
Configuration File Management Commands
FTP Server Configuration Commands
FTP Client Configuration Commands
display ftp client configuration
TFTP Client Configuration Commands
display tftp client configuration
l The term switch in this document refers to a switch in a generic sense or an access controller configured with the switching function unless otherwise specified.
l Throughout this document, a filename can be entered as either of the following: A fully qualified filename with the path included to indicate a file under a specific path. The filename can be 1 to 135 characters in length; A short filename with the path excluded to indicate a file in the current path. The filename can be 1 to 91 characters in length.
File System Configuration Commands
cd
Syntax
cd directory
View
User view
Parameters
directory: Name of the target directory.
Description
Use the cd command to change the current directory.
Examples
# Change the current directory to the Flash:.
<Sysname> cd flash:/
# Return to the upper directory.
<Sysname> cd ..
# Return to the root directory.
<Sysname> 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.
Examples
# Copy file testcfg.cfg and save it as tt.cfg.
<Sysname> copy testcfg.cfg tt.cfg
Copy flash:/testcfg.cfg to flash:/tt.cfg?[Y/N]:y
%Copy file flash:/testcfg.cfg to flash:/tt.cfg...Done.
delete
Syntax
delete [ /unreserved ] file-url
View
User view
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 expansion of txt, you may use the delete *.txt command.
Description
Use the delete command to remove a specified file from the storage device 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 displays the files removed to the recycle bin. These files are enclosed in pairs of brackets.
This command supports the wildcard *.
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 the file tt.cfg from the root directory.
<Sysname> delete tt.cfg
Delete flash:/tt.cfg?[Y/N]:y
.
%Delete file flash:/tt.cfg...Done.
dir
Syntax
dir [ /all | file-url ]
View
User view
Parameters
/all: Displays all files (including those in the recycle bin).
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 on your device, including hidden files, hidden subfiles and those in the recycle bin. The names of these deleted files are enclosed in pairs of brackets ([ ]).
The dir file-url command displays information about a file or folder.
This command supports the wildcard *.
Examples
# Display information about all files and folders.
<Sysname> dir /all
Directory of flash:/
0 -rw- 6985954 Apr 26 2005 21:06:29 mainup.bin
1 -rwh 1842 Apr 27 2005 04:37:17 private-data.txt
2 -rw- 1518 Apr 26 2005 12:05:38 config.cfg
3 -rw- 2045 May 04 2005 15:50:01 backcfg.cfg
4 -rwh 428 Apr 27 2005 16:41:21 hostkey
5 -rwh 572 Apr 27 2005 16:41:31 serverkey
6 -rw- 2737556 Oct 12 2005 01:31:44 [a.app]
14605 KB total (6875 KB free)
[ ] indicates this file is in the recycle bin.
execute
Syntax
execute filename
View
System view
Parameters
filename: Name of a batch file with a .bat extension.
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.
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.
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.
A batch file does not support hot backup.
Each configuration command in a batch file must be a standard configuration command, meaning the valid configuration information which 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
file prompt
Syntax
file prompt { alert | quiet }
View
System view
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 to warn 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 prevent undesirable consequents resulted from misoperations, the alert mode is preferred.
Examples
# Set the file operation prompt mode to alert.
<Sysname> system-view
[Sysname] file prompt alert
fixdisk
Syntax
fixdisk device
View
User view
Parameters
device: Storage device name.
Description
Use the fixdisk command to restore the space of a storage device when it becomes unavailable because of some abnormal operation.
Examples
# Restore the space of the Flash.
<Sysname> fixdisk flash:
Fixdisk flash: may take some time to complete.
%Fixdisk flash: completed.
format
Syntax
format device
View
User view
Parameters
device: Storage device name.
Description
Use the format command to format a storage device.
Formatting a device results in loss of all the files and these files cannot be restored. In particular, if there is startup configuration file on a storage device, formatting the storage device 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.
mkdir
Syntax
mkdir directory
View
User view
Parameters
directory: Name of a subdirectory.
Description
Use the mkdir command to create a subdirectory under the specified directory on the storage device.
The name of the subdirectory to be created must be unique under the specified directory.
This command does not allow you to create multiple directory levels at one time. For instance, to create a subdirectory “flash:/test/mytest”, the test directory must have been created.
Examples
# Create a directory named test.
<Sysname> mkdir test
% Created dir flash:/test
# create a subdirectory named mytest under test.
<Sysname>mkdir test/mytest
%Created dir flash:/test/mytest
more
Syntax
more file-url
View
User view
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 .txt files.
Examples
# Display the contents of file test.txt.
<Sysname> 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.
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.
Examples
# Move the file flash:/test/sample.txt to flash:/sample.txt.
<Sysname> 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
pwd
Syntax
pwd
View
User view
Parameters
None
Description
Use the pwd command to display the current path.
If the current path is not set, the operation will fail.
Examples
# Display the current path.
<Sysname> pwd
flash:
rename
Syntax
rename fileurl-source fileurl-dest
View
User view
Parameters
fileurl-source: Name of the source file or directory.
fileurl-dest: Name of the target file or directory.
Description
Use the rename command to rename a file or directory.
The target file name must be unique under the current path.
Examples
# Rename the file sample.txt as sample.bak.
<Sysname> 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
reset recycle-bin
Syntax
reset recycle-bin [ /force ]
View
User view
Parameters
/force: Empties the recycle bin.
Description
Use the reset recycle-bin command to permanently remove deleted file or files from the recycle bin.
Unlike this command, the delete file-url command only moves files to the recycle bin.
Examples
# Empty the recycle bin.
<Sysname> reset recycle-bin
Clear flash:/tt.cfg ?[Y/N]:y
Clearing files from flash may take a long time. Please wait...
.
%Cleared file flash:/~/tt.cfg.
rmdir
Syntax
rmdir directory
View
User view
Parameters
directory: Name of the directory.
Description
Use the rmdir command to remove a directory.
The directory must be an empty one. If it is not, first delete all files and subdirectory under it with the delete command.
Examples
# Remove directory mydir.
<Sysname> rmdir mydir
Rmdir flash:/mydir?[Y/N]:y
.
%Removed directory flash:/mydir.
undelete
Syntax
undelete file-url
View
User view
Parameters
filename: 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 ask you whether to continue.
Examples
# Restore file sample.bak from the recycle bin.
<Sysname> undelete sample.bak
Undelete flash:/sample.bak ?[Y/N]:y
% Undeleted file flash:/sample.bak
Configuration File Management Commands
backup startup-configuration
Syntax
backup startup-configuration to dest-addr [ dest-filename ]
View
User view
Parameters
dest-addr: IP address or name of a TFTP server. The address cannot be an IPv6 address.
dest-filename: Target filename used to save the next startup configuration file on the server.
Description
Use the backup startup-configuration command to backup the startup configuration file (for next startup) using a filename you specify. If you do not specify this filename, the original filename is used.
Execution of this command only backups the main startup configuration file for next startup.
Presently, the device uses TFTP to backup configuration files.
Examples
# Backup the configuration file for next startup on the TFTP server with IP address 2.2..2.2, using the filename config.cfg.
<Sysname> backup startup-configuration to 2.2.2.2 config.cfg
Backup next startup-configuration file to 2.2.2.2, please wait…
finished!
<Sysname>
display saved-configuration
Syntax
display saved-configuration [ by-linenum ]
View
Any view
Parameters
by-linenum: Identifies each line of displayed information with a line number.
Description
Use the display saved-configuration command to display the initial configuration file saved in the storage device.
In case the device malfunctions after being powered on, if you find some configurations are not validated or incorrect, you may use this command to identify the problem.
If you do not use the configuration file when the device starts up, meaning the displayed startup configuration file is NULL after you execute the display startup command, no information is displayed when you execute the display saved-configuration command; if you have saved the configuration file after the device starts up, the information last saved in the configuration file is displayed.
Related commands: save, reset saved-configuration, display current-configuration in System Maintaining and Debugging in H3C WX6103 Access Controller Switch Interface Board Command Reference.
Examples
# Display the configuration file saved in the storage device.
<system> display saved-configuration
#
version 5.20, Alpha 2101
#
sysname Sysname
#
undo info-center enable
#
domain default enable system
#
ipv6
#
telnet server enable
#
sflow agent ip 192.168.0.153
sflow collector ip 192.168.0.250
#
multicast routing-enable
#
vlan 1
#
vlan 40
#
radius scheme system
server-type extended
primary authentication 127.0.0.1 1645
primary accounting 127.0.0.1 1646
user-name-format without-domain
#
domain system
access-limit disable
state active
idle-cut disable
self-service-url disable
#
isis 1
network-entity 10.0000.0001.1111.1111.00
#
interface NULL0
#
interface Vlan-interface1
ipv6 address 2001:131::3333/64
ip address 192.168.0.153 255.255.255.0
isis enable 1
#
interface Vlan-interface40
ip address 200.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet0/0/10
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet0/0/11
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet0/0/12
port link-type trunk
port trunk permit vlan all
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet01/0/24
#
user-interface aux 0
idle-timeout 0 0
user-interface vty 0 4
authentication-mode none
user privilege level 3
#
return
The configurations are displayed in the order of global, port, and user interface.
display startup
Syntax
display startup
View
Any view
Parameters
None
Description
Use the display startup command to display the configuration file used at this startup and the one used for next startup.
Related commands: startup saved-configuration.
Examples
# Display the configuration file used at this startup and the one used for next startup.
<Sysname> display startup
Current startup saved-configuration file: flash:/testcfgconfig.cfg
Next main startup saved-configuration file: flash:/testcfgconfig.cfg
reset saved-configuration
Syntax
reset saved-configuration
View
User view
Parameters
None
Description
Use the reset saved-configuration command to erase the configuration file saved in the storage device.
This command will permanently delete the configuration file on the device. Use it with caution.
Related commands: save, display saved-configuration.
Examples
# Erase the configuration file saved in the storage device.
<Sysname> reset saved-configuration
The saved configuration file will be erased.
Configuration file in flashthe device is being cleared.
Configuration in flashthe device is cleared.
restore startup-configuration
Syntax
restore startup-configuration from src-addr src-filename
View
User view
Parameters
src-addr: IP address or name of a TFTP server. The address cannot be an IPv6 address.
src-filename: Filename of the configuration file to be downloaded from the specified server.
Description
Use the restore startup-configuration command to download the configuration file from the specified TFTP server for the next startup of the device.
If the file to be downloaded has the same filename as an existing file on the device, you will be prompted whether you want to overwrite the existing file or not.
Examples
# Download the configuration file config.cfg for the next startup from the TFTP server whose IP address is .2.2.2.2.
<Sysname>restore startup-configuration from 2.2.2.2 config.cfg
Restore next startup-configuration file from 2.2.2.2. Please wait...finished!
Now restore next startup-configuration file from main to slave board, Please wait...finished!
save
Syntax
save [ file-name | [ safely ]
View
Any view
Parameters
file-name: File name, whose suffix 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.
Description
Use the save command to save the current configuration to the specified configuration file. If no filename is specified, the system saves the configuration file in an interactive way. In this way, you can use the default path (the configuration file for next startup) or enter a filename to specify a new path, but the suffix of the filename must be “.cfg”.
Related commands: reset saved-configuration, display current-configuration, display saved-configuration.
Examples
# Save the current configuration to the backup configuration file.
<Sysname> save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
flash:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait...
Now saving current configuration to the device.
Saving configuration flash:/startup.cfg. Please wait...
..................
Configuration is saved to flash successfully.
<Sysname>
startup saved-configuration
Syntax
startup saved-configuration cfgfile
undo startup saved-configuration
View
User view
Parameters
cfgfile: Configuration file name.
Description
Use the startup saved-configuration command to specify a configuration file for next startup.
Use the undo startup saved-configuration command to start up with an empty configuration, which means startup with the initial configuration of the system.
The specified file must be ended with a .cfg extension and saved in the root directory of the storage device.
Related commands: display startup.
Examples
# Specify a backup configuration file for next startup.
<Sysname> startup saved-configuration testcfg.cfg
Please wait ...... Done!
FTP Server Configuration Commands
display ftp-server
Syntax
display ftp-server
View
Any view
Parameters
None
Description
Use the display ftp-server command to display the FTP server configuration of the device.
After configuring FTP parameters, you may verify them with this command.
Related commands: ftp timeout, ftp update.
Examples
# Display the FTP server configuration.
<Sysname> display ftp-server
FTP server is running
Max user number: 1
User count: 1
Timeout value(in minute): 30
Put Method: fast
The output indicates that the FTP server is running with support to only one concurrent login user; now one logged-in user is present; timeout of the user is 30 minutes, and FTP update mode is fast.
display ftp-user
Syntax
display ftp-user
View
Any view
Parameters
None
Description
Use the display ftp-user command to display the detailed information of current FTP users.
Examples
# Display the detailed information of FTP users.
<Sysname> display ftp-user
UserName HostIP Port Idle HomeDir
ftp 192.168.1.54 1190 0 flash:
Table 2-1 display ftp-user command output description
Field |
Description |
UserName |
Name of the present logged-in user |
HostIP |
IP address of the present logged-in user |
Port |
Port which the present logged-in user is using |
Idle |
Duration time of the current FTP connection |
HomeDir |
Specified path of the present logged-in user |
free ftp user
Syntax
free ftp user username
View
User view
Parameters
username: Username used when the FTP connection to be released is established.
Description
Use the free ftp user command to manually release the FTP connection established with the specified username.
Note that if the user to be released is transmitting a file, the connection between the user and the FTP server is terminated after the file transmission.
Examples
# Manually release the FTP connection established with username of ftpuser.
<Sysname> free ftp user ftpuser
Are you sure to free FTP user ftpuser? [Y/N]:y
<Sysname>
ftp server enable
Syntax
ftp server enable
undo ftp server
View
System view
Parameters
None
Description
Use the ftp server enable command to enable the FTP server.
Use the undo ftp server command to disable the FTP server.
By default, the FTP server is disabled to prevent attacks.
Examples
# Disable the FTP server.
<Sysname> system-view
[Sysname] undo ftp server
% Close FTP server
ftp timeout
Syntax
ftp timeout minute
undo ftp timeout
View
System view
Parameters
minute: Idle-timeout timer in minutes, in the range 1 to 35791. The default is 30 minutes.
Description
Use the ftp timeout command to set the idle-timeout timer.
Use the undo ftp timeout command to restore the default.
After you log onto the FTP server, you set up an FTP connection. When the connection is disrupted, the FTP server, if not notified, cannot realize that and maintains the connection all the same. To address this problem, you can set an idle-timeout timer to have the FTP server disconnected if no information is received or/and transmitted before the timer expires.
Examples
# Set the idle-timeout timer to 36 minutes.
<Sysname> system-view
[Sysname] ftp timeout 36
ftp update
Syntax
ftp update { fast | normal }
undo ftp update
View
System view
Parameters
fast: Fast update.
normal: Normal update.
Description
Use the ftp update command to set the file update mode that the FTP server uses while receiving data.
Use the undo ftp update command to restore the default, namely, the normal mode.
Examples
# Set the FTP update mode to normal.
<Sysname> system-view
[Sysname] ftp update normal
FTP Client Configuration Commands
You must use the ftp command to enter FTP client view for configurations under this view. For details, refer to ftp.
ascii
Syntax
ascii
View
FTP client view
Parameters
None
Description
Use the ascii command to set the file transfer mode to ASCII for the FTP connection.
FTP provides two file transfer modes: ASCII and binary. To transfer text files, use the ASCII mode; to transfer program files, use the binary mode.
By default, the file transfer mode is ASCII.
Examples
# Set the file transfer mode to ASCII.
[ftp] ascii
200 Type set to A.
binary
Syntax
binary
View
FTP client view
Parameters
None
Description
Use the binary command to set the file transfer mode to binary (also called flow mode).
FTP provides two file transfer modes: ASCII and binary. To transfer text files, use the ASCII mode; to transfer program files, use the binary mode.
By default, the transfer mode is ASCII mode.
Examples
# Set the file transfer mode to binary.
[ftp] binary
200 Type set to I.
bye
Syntax
bye
View
FTP client view
Parameters
None
Description
Use the bye command to disconnect from the remote FTP server and exit to user view.
Examples
# Terminate the connection with the remote FTP server and exit to user view.
[ftp] bye
221 Server closing.
cd
Syntax
cd pathname
View
FTP client view
Parameters
pathname: Path name.
Description
Use the cd command to change the current working directory on the remote FTP server.
You can use this command to access another authorized directory on the FTP server.
Examples
# Change the current working directory to flash:/logfile.
[ftp] cd flash:/logfile
250 CWD command successful.
cdup
Syntax
cdup
View
FTP client view
Parameters
None
Description
Use the cdup command to exit the current directory and enter the upper directory of the FTP server.
Examples
# Change the current working directory path to the upper directory.
[ftp] cdup
200 CDUP command successful.
close
Syntax
close
View
FTP client view
Parameters
None
Description
Use the close command to terminate the connection to the FTP server, but remain in FTP client view.
This command is equal to the disconnect command.
Examples
# Terminate the connection to the FTP server and remain in FTP client view.
[ftp] close
221 Server closing.
[ftp]
debugging
Syntax
debugging
undo debugging
View
FTP client view
Parameters
None
Description
Use the debugging command to enable FTP client debugging.
Use the undo debugging command to disable FTP client debugging.
By default, FTP client debugging is disabled.
Examples
# The device serves as the FTP client. Enable FTP client debugging and use the active mode to download file sample.file from the current directory of the FTP server.
<Sysname> terminal monitor
<Sysname> terminal debugging
<Sysname> ftp 192.168.1.46
Trying 192.168.1.46 ...
Press CTRL+K to abort
Connected to 192.168.1.46.
220 FTP service ready.
User(192.168.1.46:(none)):ftp
331 Password required for ftp.
Password:
230 User logged in.
[ftp]undo passive
[ftp] debugging
[ftp] get sample.file
---> PORT 192,168,1,44,4,21
200 Port command okay.
The parsed reply is 200
---> RETR sample.file
150 Opening ASCII mode data connection for sample.file.
The parsed reply is 150
FTPC: File transfer started with the signal light turned on.
FTPC: File transfer completed with the signal light turned off.
.226 Transfer complete.
FTP: 3304 byte(s) received in 4.889 second(s), 675.00 byte(s)/sec.
[ftp]
Table 2-2 debugging command output description
Field |
Description |
---> PORT |
Give an FTP order, with data port numbers being… |
The parsed reply is |
The received reply code, which is defined in RFC 959. |
---> RETR |
Download the file |
FTPC: File transfer started with the signal light turned on. |
File transfer starts, and the signal light is turned on. |
FTPC: File transfer completed with the signal light turned off. |
File transfer is completed, and the signal light is turned off. |
delete
Syntax
delete remotefile
View
FTP client view
Parameters
remotefile: File name.
Description
Use the delete command to delete a specified file on the remote FTP server.
To do this, you must be a user with the delete permission on the FTP server.
Examples
# Delete file temp.c.
[ftp] delete temp.c
250 DELE command successful.
dir
Syntax
dir [ remotefile [ localfile ] ]
View
FTP client view
Parameters
remotefile: Name of the file or directory on the remote FTP server.
localfile: Name of the local file to save the displayed information.
Description
Use the dir command to view detailed information of the files and subdirectories under the current directory on the remote FTP server.
Use the dir remotefile command to display the detailed information of the specified file or directory on the remote FTP server.
Use the dir remotefile localfile command to display the detailed information of the specified file or directory on the remote FTP server, and save the displayed information into a local file specified by the localfile argument.
The Is command can only display the names of files and directories, whereas the dir command can display other related information of the files and directories, such as the size, the date they were created.
Examples
# View the information of the file ar-router.cfg, and save the result to aa.txt.
[ftp] dir ar-router.cfg aa.txt
227 Entering Passive Mode (192,168,1,50,17,158).
125 ASCII mode data connection already open, transfer starting for ar-router.cfg.
....226 Transfer complete.
FTP: 67 byte(s) received in 4.600 second(s), 14.00 byte(s)/sec.
# View the content of aa.txt
[ftp] quit
<Sysname> more aa.txt
-rwxrwxrwx 1 noone nogroup 3077 Jun 20 15:34 ar-router.cfg
disconnect
Syntax
disconnect
View
FTP client view
Parameters
None
Description
Use the disconnect command to disconnect from the remote FTP server but remain in FTP client view.
This command is equal to the close command.
Examples
# Disconnect from the remote FTP server but remain in FTP client view.
[ftp] disconnect
221 Server closing.
display ftp client configuration
Syntax
display ftp client configuration
View
Any view
Parameters
None
Description
Use the display ftp client configuration command to display the configuration information of the FTP client.
Currently this command displays the configuration information of the source address. If the currently valid source address is the source IP address, this command displays the configured source IP address; if it is the source interface, this command displays the configured source interface.
Related commands: ftp client source.
Examples
# Display the current configuration information of the FTP client.
<Sysname> display ftp client configuration
The source IP address is 192.168.0.123
ftp
Syntax
ftp [ server-address [ service-port ] [ source { interface interface-type interface-number | ip source-ip-address } ] ]
View
User view
Parameters
server-address: IP address or host name of a remote FTP server.
service-port: Port number of the remote FTP server, in the range 0 to 65535. The default value is 21.
interface interface-type interface-number: Specifies the source interface by its type and number. The primary IP address configured on this interface is the source address of the transmitted packets. If no primary IP address is configured on the source interface, the connection fails.
ip source-ip-address: The source IP address of the current FTP client. This source address must be the one that has been configured on the device.
Description
Use the ftp command to log onto the remote FTP server and enter FTP client view.
Note that:
l This command applies to IPv4 network.
l If you use this command without specifying any parameters, you will simply enter the FTP client view without logging onto the FTP server.
l If you specify the parameter, you will be asked to enter the username and password for accessing the FTP server.
The priority of the source address specified with this command is higher than that with the ftp client source command. If you specify the source address with the ftp client source command first and then with the ftp command, the source address specified with the ftp command is used to communicate with the FTP server.
Related commands: ftp client source.
Examples
# Log from the current device Sysname1 onto the device Sysname2 with the IP address of 192.168.0.211. The source IP address of the packets sent is 192.168.0.212.
<Sysname1> ftp 192.168.0.211 source ip 192.168.0.212
Trying 192.168.0.211 ...
Press CTRL+K to abort
Connected to 192.168.0.211.
220 FTP Server ready
User(192.168.0.211:(none)):abc
331 Password required for abc
Password:
230 Login OK
[ftp]
ftp client source
Syntax
ftp client source { interface interface-type interface-number | ip source-ip-address }
undo ftp client source
View
System view
Parameters
interface interface-type interface-number: Source interface for the FTP connection, including interface type and interface number. The primary IP address configured on the source interface is the source IP address of the packets sent by FTP. If no primary IP address is configured on the source interface, the connection fails.
ip source-ip-address: Source IP address of the FTP connection. It must be an IP address that has been configured on the device.
Description
Use the ftp client source command to configure the source address of the transmitted FTP packets from the FTP client.
Use the undo ftp client source command to restore the default.
By default, a device uses the IP address of the interface determined by the routing protocol as the source IP address to communicate with an FTP server.
Note that:
l The source address includes the source interface and the source IP address. If you use the ftp client source command to specify the source interface and the source IP address, the newly specified source IP address overwrites the original one and vice versa.
l If the source address is specified with the ftp client source command and then with the ftp command, the source address specified with the latter one is used to communicate with the FTP server.
l The source address specified with the ftp client source command is valid for all ftp connections and the source address specified with the ftp command is valid only for the current ftp connection.
Related commands: display ftp client configuration.
Examples
# Specify the source IP address of the FTP client as 2.2.2.2.
<Sysname> system-view
[Sysname] ftp client source ip 2.2.2.2
# Specify the source interface of the FTP client as VLAN-interface 1.
<Sysname> system-view
[Sysname] ftp client source interface Vlan-interface 1
ftp ipv6
Syntax
ftp ipv6 [ server-address [ service-port ] [ source ipv6 source-ipv6-address ] [ -i interface-type interface-number ] ]
View
User view
Parameters
server-address: IP address or host name of the remote FTP server.
service-port: Port number of the FTP server, in the range 0 to 65535. The default value is 21.
source ipv6 source-ipv6-address: Specifies a source IPv6 address for transmitted FTP packets. This address must be an IPv6 address that has been configured on the device.
-i interface-type interface-number: Specifies the type and number of the egress interface. This parameter can be used only in case that the FTP server address is the link local address and the specified egress interface must have a link local address (For the configuration of link local address, see the IPv6 in H3C WX6103 Access Controller Switch Interface Board Configuration Guide
Description
Use the ftp ipv6 command to log onto the FTP server and enter FTP client view.
Note that:
l This command applies to IPv6 network.
l If you use this command without specifying any parameters, you will simply enter the FTP client view without logging onto the FTP server.
l If you specify the parameter, you will be asked to enter the username and password for accessing the FTP server.
Examples
# Log onto the FTP server with IPv6 address 3000::200.
<Sysname> ftp ipv6 3000::200
Trying 3000::200 ...
Press CTRL+K to abort
Connected to 3000::200.
220 Welcome!
User(3000::200:(none)): MY_NAME
331 Please specify the password.
Password:
230 Login successful.
[ftp]
get
Syntax
get remotefile [ localfile ]
View
FTP client view
Parameters
remotefile: File name on the remote FTP server.
localfile: Local file name.
Description
Use the get command to download a file from a remote FTP server and save it.
If no name is specified, the local file uses the name of the source file on the FTP server by default.
Examples
# Download file testcfg.cfg and save it as aa.cfg.
[ftp]get testcfg.cfg aa.cfg
227 Entering Passive Mode (192,168,1,50,17,163).
125 ASCII mode data connection already open, transfer starting for testcfg.cfg.
.....226 Transfer complete.
FTP: 5190 byte(s) received in 7.754 second(s), 669.00 byte(s)/sec.
lcd
Syntax
lcd
View
FTP client view
Parameters
None
Description
Use the lcd command to display the local directory of the FTP client.
Examples
# Display the local directory.
[ftp] lcd
FTP: Local directory now flash:/temp
ls
Syntax
ls [ remotefile ] [ localfile ] ]
View
FTP client view
Parameters
remotefile: Filename or directory on the remote FTP server.
localfile: Name of a local file used to save the displayed information.
Description
Use the ls command to view the information of all the files and subdirectories under the current directory of the remote FTP server. The file names and subdirectory names are displayed.
Use the ls remotefile command to view the information of a specified file or subdirectory.
Use the ls remotefile localfile command view the information of a specified file or subdirectory, and save the result to a local file specified by the localfile argument.
The Is command can only display the names of files and directories, whereas the dir command can display other related information of the files and directories, such as the size, the date they are created.
Examples
# View the information of all files and subdirectories under the current directory of the FTP server.
[ftp] ls
227 Entering Passive Mode (192,168,1,50,17,165).
125 ASCII mode data connection already open, transfer starting for *.
ar-router.cfg
logfile
mainar.bin
arbasicbtm.bin
ftp
test
bb.cfg
testcfg.cfg
226 Transfer complete.
FTP: 87 byte(s) received in 0.132 second(s) 659.00 byte(s)/sec.
# View the information of directory logfile, and save the result to file aa.txt.
[ftp] ls logfile aa.txt
227 Entering Passive Mode (192,168,1,50,17,166).
125 ASCII mode data connection already open, transfer starting for logfile.
.....226 Transfer complete.
FTP: 9 byte(s) received in 0.094 second(s) 95.00 byte(s)/sec.
# View the content of file aa.txt.
[ftp] quit
<Sysname> more aa.txt
logfile
mkdir
Syntax
mkdir directory
View
FTP client view
Parameters
directory: Directory name.
Description
Use the mkdir command to create a subdirectory under the specified directory on the remote FTP server.
To do this, you must be a user with the permission on the FTP server.
Examples
# Create subdirectory mytest on the current directory of the remote FTP server.
[ftp] mkdir mytest
257 " flash:/mytest" new directory created.
open
Syntax
open server-address [ service-port ]
View
FTP client view
Parameters
server-address: IP address or host name of a remote FTP server.
service-port: Port number of the remote FTP server, in the range 0 to 65535, with the default value of 21.
Description
Use the open command to log onto the IPv4 FTP server under FTP client view.
At login, you will be asked to enter the username and password for accessing the FTP server. If your input is correct, the login succeeds; otherwise, it fails.
Related commands: close.
Examples
# In FTP client view, log onto the FTP server with the IP address of 192.168.1.50.
<Sysname> ftp
[ftp] open 192.168.1.50
Trying 192.168.1.50 ...
Press CTRL+K to abort
Connected to 192.168.1.50.
220 FTP service ready.
User(192.168.1.50:(none)):aa
331 Password required for aa.
Password:
230 User logged in.
[ftp]
open ipv6
Syntax
open ipv6 server-address [ service-port ] [ -i interface-type interface-number ]
View
FTP client view
Parameters
server-address: IP address or host name of the remote FTP server.
service-port: Port number of the remote FTP server, in the range 0 to 65535. The default value is 21.
-i interface-type interface-number: Specifies the egress interface by it type and number. This parameter can be used only in case that the FTP server address is the link local address and the specified egress interface must have a link local address (For the configuration of link local address, see the IPv6 in H3C WX6103 Access Controller Switch Interface Board Configuration Guide .
Description
Use the open ipv6 command to log onto IPv6 FTP server in FTP client view.
At login, you will be asked to enter the username and password for accessing the FTP server. If your input is correct, the login succeeds; otherwise, it fails.
Related commands: close.
Examples
# Log onto the FTP server (with IPv6 address 3000::200) in FTP client view.
<Sysname> ftp
[ftp] open ipv6 3000::200
Trying 3000::200 ...
Press CTRL+K to abort
Connected to 3000::200.
220 Welcome!
User(3000::200:(none)): MY_NAME
331 Please specify the password.
Password:
230 Login successful.
passive
Syntax
passive
undo passive
View
FTP client view
Parameters
None
Description
Use the passive command to set the data transmission mode to passive.
Use the undo passive command to set the data transmission mode to active.
The default transmission mode is passive.
Examples
# Set the data transmission mode to passive.
[ftp] passive
FTP: passive is on
put
Syntax
put localfile [ remotefile ]
View
FTP client view
Parameters
localfile: Local file name.
remotefile: Name of the file to be saved on the remote FTP server.
Description
Use the put command to upload a file to the remote FTP server.
If no name is assigned to the file to be saved on the FTP server, the name of the source file is used by default.
Examples
# Upload source file cc.txt to the remote FTP server and save it as dd.txt.
[ftp] put cc.txt dd.txt
227 Entering Passive Mode (192,168,1,50,17,169).
125 ASCII mode data connection already open, transfer starting for dd.txt.
226 Transfer complete.
FTP: 9 byte(s) sent in 0.112 second(s), 80.00byte(s)/sec.
pwd
Syntax
pwd
View
FTP client view
Parameters
None
Description
Use the pwd command to display the working directory on the remote FTP server.
Examples
# Display the working directory on the remote FTP server.
[ftp] pwd
257 "flash:/temp" is current directory.
quit
Syntax
quit
View
FTP client view
Parameters
None
Description
Use the quit command to disconnect from the remote FTP server and exit to user view.
Examples
# Disconnect from the remote FTP server and exit to user view.
[ftp] quit
221 Server closing.
<Sysname>
remotehelp
Syntax
remotehelp [ protocol-command ]
View
FTP client view
Parameters
protocol-command: FTP command.
Description
Use the remotehelp command to display the help information of FTP-related commands supported by the remote FTP server.
If no parameter is specified, FTP-related commands supported by the remote FTP server are displayed.
Examples
# Display FTP commands supported by the remote FTP server.
[ftp] remotehelp
214-Here is a list of available ftp commands
Those with '*' are not yet implemented.
USER PASS ACCT* CWD CDUP SMNT* QUIT REIN*
PORT PASV TYPE STRU* MODE* RETR STOR STOU*
APPE* ALLO* REST* RNFR* RNTO* ABOR* DELE RMD
MKD PWD LIST NLST SITE* SYST STAT* HELP
NOOP* XCUP XCWD XMKD XPWD XRMD
214 Direct comments to H3C company.
# Display the help information for the user command.
[ftp] remotehelp user
214 Syntax: USER <sp> <username>.
[ftp]
Table 2-3 remotehelp command output description
Field |
Description |
214-Here is a list of available ftp commands |
The following is an available FTP command list. |
Those with '*' are not yet implemented. |
Those commands with “*” are not yet implemented. |
USER |
Username |
PASS |
Password |
CWD |
Change the current working directory |
CDUP |
Change to parent directory |
SMNT* |
File structure setting |
QUIT |
Quit |
REIN* |
Re-initialization |
PORT |
Port number |
PASV |
Passive mode |
TYPE |
Request type |
STRU* |
File structure |
MODE* |
Transmission mode |
RETR |
Download a file |
STOR |
Upload a file |
STOU* |
Store unique |
APPE* |
Appended file |
ALLO* |
Allocation space |
REST* |
Restart |
RNFR* |
Rename the source |
RNTO* |
Rename the destination |
ABOR* |
Abort the transmission |
DELE |
Delete a file |
RMD |
Delete a folder |
MKD |
Create a folder |
PWD |
Print working directory |
LIST |
List files |
NLST |
List file description |
SITE* |
Orient a parameter |
SYST |
Display system parameters |
STAT* |
State |
HELP |
Help |
NOOP* |
No operation |
XCUP |
Extension command, the same meaning as CUP |
XCWD |
Extension command, the same meaning as CWD |
XMKD |
Extension command, the same meaning as MKD |
XPWD |
Extension command, the same meaning as PWD |
XRMD |
Extension command, the same meaning as RMD |
Syntax: USER <sp> <username>. |
Syntax of the user command: user (keyword) + space + username |
rmdir
Syntax
rmdir directory
View
FTP client view
Parameters
directory: Directory name on the remote FTP server.
Description
Use the rmdir command to remove a specified directory from the FTP server.
Note that only authorized users are allowed to use this command.
Note that:
l The directory to be deleted must be empty, meaning you should delete all files and the subdirectory under the directory before you delete a directory. For the deletion of files, refer to the delete command.
l After you execute the rmdir command, the files in the remote recycle bin under the directory will be automatically deleted.
Examples
# Delete the flash:/temp1 directory from the FTP server.
[ftp] rmdir flash:/temp1
200 RMD command successful.
user
Syntax
user username [ password ]
View
FTP client view
Parameters
username: Other login username.
password: Login password.
Description
Use the user command to relog onto the currently accessing FTP server with other username after you have logged onto the FTP server.
Before using this command, you must configure the corresponding username and password on the FTP server; otherwise, you login fails and the FTP connection is closed.
Examples
# User ftp1 has logged onto the FTP server and relogs onto the current FTP server with the username of ftp2. (Suppose username ftp2 and password 123123123123 have been configured on the FTP server).
[ftp] user ftp2
331 Password required for ftp2.
Password:
230 User logged in.
[ftp]
verbose
Syntax
verbose
undo verbose
View
FTP client view
Parameters
None
Description
Use the verbose command to enable the verbose function to display detailed prompt information.
Use the undo verbose command to disable the verbose function.
By default, the verbose function is enabled.
Examples
# Enable the verbose function.
[ftp] verbose
FTP: verbose is on
TFTP Client Configuration Commands
display tftp client configuration
Syntax
display tftp client configuration
View
Any view
Parameters
None
Description
Use the display tftp client configuration command to display the configuration information of the TFTP client.
Related commands: tftp client source.
Examples
# Display the current configuration information of the TFTP client.
<Sysname> display tftp client configuration
The source IP address is 192.168.0.123
Currently this command displays the source address configuration information. If the currently valid source address is the source IP address, the configured source IP address is displayed; if the currently valid address is the source interface, the configured source interface is displayed.
tftp-server acl
Syntax
tftp-server [ ipv6 ] acl acl-number
undo tftp-server [ ipv6 ] acl
View
System view
Parameters
ipv6: References an IPv6 ACL. If it is not specified, an IPv4 ACL is referenced.
acl-number: Number of basic ACL, in the range 2000 to 2999.
Description
Use the tftp-server acl command to reference an ACL to control access to the TFTP server. Users can use the configured rules in ACL to allow or prevent the use of TFTP server in a network.
Use the undo tftp-server acl command to remove the access restriction.
For more information about ACL, refer to the ACL in H3C WX6103 Access Controller Switch Interface Board Configuration Guide
Examples
# Reference ACL 2000 to control access to the TFTP application in IPv4.
<Sysname> system-view
[Sysname] acl number 2000
[Sysname-acl-basic-2000] rule permit source 1.1.1.1 0
[Sysname-acl-basic-2000] quit
[Sysname] tftp-server acl 2000
# Associate IPv6 ACL 2001 with TFTP application in Ipv6.
<Sysname> system-view
[Sysname] acl ipv6 number 2001
[Sysname-acl6-basic-2001] rule permit source 2030:5060::9050/64
[Sysname-acl6-basic-2001] quit
[Sysname] tftp-server ipv6 acl 2001
tftp
Syntax
tftp server-address { get | put | sget } source-filename [ destination-filename ] [ source { interface interface-type interface-number | ip source-ip-address } ]
View
User view
Parameters
server-address: IP address or host name of a TFTP server.
source-filename: Source file name.
destination-filename: Destination file name.
get: Downloads a file in normal mode.
put: Uploads a file.
sget: Downloads a file in secure mode.
source: Configures parameters for source address binding.
l interface interface-type interface-number: Specifies the source interface by its type and number. The primary IP address configured on the source interface is the source IP address of the packets sent by TFTP. If no primary IP address is configured on the source interface, the transmission fails.
l ip source-ip-address: Specifies the source IP address for the current TFTP client to transmit packets. This source address must be the one that has been configured on the device.
Description
Use the tftp command to upload files from the local device to a TFTP server or download files from the TFTP server to the local device.
l If no destination file name is specified, the saved file uses the source file name.
l The priority of the source address specified with this command is higher than that with the tftp client source command. If you use the tftp client source command to specify the source address first and then with the tftp command, the latter one is adopted.
This command applies to IPv4 network.
Related commands: tftp client source.
Examples
# Download the config.cfg file from the TFTP server with the IP address of 192.168.0.98 and save it as config.bak. Specify the source IP address to be 192.168.0.92.
<Sysname> tftp 192.168.0.98 get config.cfg config.bak source ip 192.168.0.92
.
File will be transferred in binary mode
Downloading file from remote tftp server, please wait...\
TFTP: 2143 bytes received in 0 second(s)
File downloaded successfully.
# Upload the config.cfg file from the storage device to the default path of the TFTP server with the IP address of 192.168.0.98 and save it as config.bak. Specify the source IP interface to be VLAN-interface 1.
<Sysname> tftp 192.168.0.98 put config.cfg config.bak source interface vlan-interface 1
.
File will be transferred in binary mode
Sending file to remote tftp server. Please wait... \
TFTP: 2143 bytes sent in 0 second(s).
File uploaded successfully.
tftp client source
Syntax
tftp client source { interface interface-type interface-number | ip source-ip-address }
undo tftp client source
View
System view
Parameters
interface interface-type interface-number: Specifies the source interface by its type and number. The primary IP address configured on the source interface is the source IP address of the packets sent by FTP. If no primary IP address is configured on the source interface, the transmission fails.
ip source-ip-address: The source IP address of the TFTP connection. It must be an IP address that has been configured on the device.
Description
Use the tftp client source command to configure the source address of the TFTP packets from the TFTP client.
Use the undo telnet client source command to restore the default.
By default, a device uses the IP address of the interface determined by the routing protocol as the source IP address to communicate with a TFTP server.
Note that:
l The source address includes the source interface and the source IP, if you use the tftp client source command to specify the source interface and the source IP, the newly specified source IP overwrites the original one and vice versa.
l If the source address is specified with the tftp client source command and then with the tftp command, use the latter one.
l The source address specified with the tftp client source command is valid for all tftp connections and the source address specified with the tftp command is valid for the current tftp command.
Related commands: display tftp client configuration.
Examples
# Specify the source IP address of the TFTP client to 2.2.2.2.
<Sysname> system-view
[Sysname] tftp client source ip 2.2.2.2
# Specify the source interface of the TFTP client to be VLAN-interface 1.
<Sysname> system-view
[Sysname] ftp client source interface vlan-interface 1
tftp ipv6
Syntax
tftp ipv6 tftp-ipv6-server [ -i interface-type interface-number ] { get | put } source-file [ destination-file ]
View
User view
Parameters
tftp-ipv6-server: IPv6 address or host name (a string of 1 to 46 characters) of a TFTP server.
-i interface-type interface-number: Specifies the egress interface by its type and number. This parameter can be used only in case that the TFTP server address is a link local address and the specified egress interface must have a link local address (For the configuration of link local address, see the IPv6 in H3C WX6103 Access Controller Switch Interface Board Configuration Guide .
get: Downloads a file.
put: Uploads a file.
source-filename: Source filename.
destination-filename: Destination filename. If not specified, this filename is the same as the source filename.
Description
Use the tftp ipv6 command to download a specified file from a TFTP server or upload a specified local file to a TFTP server.
This command applies to IPv6 network.
Examples
# Download filetoget.txt from TFTP server.
<Sysname> tftp ipv6 fe80::250:daff:fe91:e058 -i vlan-interface 1 get filetoget. txt
File will be transferred in binary mode
Downloading file from remote tftp server, please wait...
TFTP: 32 bytes received in 5 second(s).