H3C S5500-SI Series Ethernet Switches Command Manual-Release 1205-(V1.03)

HomeSupportSwitchesH3C S5500 Switch SeriesReference GuidesCommand ReferencesH3C S5500-SI Series Ethernet Switches Command Manual-Release 1205-(V1.03)
03-File System Management Command
Title Size Download
03-File System Management Command 230 KB

Table of Contents

Chapter 1 File System Management Commands. 1-1

1.1 File System Configuration Commands. 1-1

1.1.1 cd. 1-1

1.1.2 copy. 1-1

1.1.3 delete. 1-2

1.1.4 dir 1-3

1.1.5 execute. 1-4

1.1.6 file prompt 1-5

1.1.7 fixdisk. 1-5

1.1.8 format 1-6

1.1.9 mkdir 1-6

1.1.10 more. 1-7

1.1.11 move. 1-8

1.1.12 pwd. 1-8

1.1.13 rename. 1-9

1.1.14 reset recycle-bin. 1-9

1.1.15 rmdir 1-10

1.1.16 undelete. 1-11

1.2 File Management Configuration Commands. 1-11

1.2.1 backup startup-configuration. 1-11

1.2.2 display saved-configuration. 1-12

1.2.3 display startup. 1-15

1.2.4 reset saved-configuration. 1-16

1.2.5 restore startup-configuration. 1-17

1.2.6 save. 1-17

1.2.7 startup saved-configuration. 1-19

Chapter 2 FTP Configuration Commands. 2-1

2.1 FTP Server Configuration Commands. 2-1

2.1.1 display ftp-server 2-1

2.1.2 display ftp-user 2-1

2.1.3 ftp server enable. 2-2

2.1.4 ftp timeout 2-2

2.1.5 ftp update. 2-3

2.2 FTP Client Configuration Commands. 2-4

2.2.1 ascii 2-4

2.2.2 binary. 2-5

2.2.3 bye. 2-5

2.2.4 cd. 2-6

2.2.5 cdup. 2-6

2.2.6 close. 2-7

2.2.7 delete. 2-7

2.2.8 dir 2-8

2.2.9 disconnect 2-9

2.2.10 ftp. 2-9

2.2.11 ftp ipv6. 2-10

2.2.12 get 2-11

2.2.13 lcd. 2-12

2.2.14 ls. 2-12

2.2.15 mkdir 2-14

2.2.16 open. 2-14

2.2.17 open ipv6. 2-15

2.2.18 passive. 2-16

2.2.19 put 2-17

2.2.20 pwd. 2-18

2.2.21 quit 2-18

2.2.22 remotehelp. 2-19

2.2.23 rmdir 2-19

2.2.24 user 2-20

2.2.25 verbose. 2-21

Chapter 3 TFTP Configuration Commands. 3-1

3.1 TFTP Client Configuration Commands. 3-1

3.1.1 tftp-server acl 3-1

3.1.2 tftp get 3-2

3.1.3 tftp ipv6. 3-2

3.1.4 tftp put 3-3

3.1.5 tftp sget 3-4

 


Chapter 1  File System Management Commands

 

&  Note:

Throughout this document, a filename can be entered as either of the following:

l      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.

l      A short filename with the path excluded to indicate a file in the current working path. The filename can be 1 to 91 characters in length.

 

1.1  File System Configuration Commands

1.1.1  cd

Syntax

cd directory

View

User view

Parameter

directory: Name of the target directory.

Description

Use the cd command to change the current directory.

Example

# Change the current directory to flash:.

<Sysname> cd flash:

1.1.2  copy

Syntax

copy fileurl-source fileurl-dest

View

User view

Parameter

fileurl-source: Name of the source file.

fileurl-dest: Name of the target file or directory.

Description

Use the copy command to copy a file.

If the name of the target file is the same with the name of an existing file, the system asks whether to overwrite the exiting one.

Example

# Copy file config.cfg and save it as tt.cfg.

<Sysname> copy config.cfg tt.cfg

Copy flash:/config.cfg to flash:/tt.cfg?[Y/N]:y

 

%Copy file flash:/config.cfg to flash:/tt.cfg...Done.

1.1.3  delete

Syntax

delete [ /unreserved ] file-url

View

User view

Parameter

/unreserved: Permanently deletes the specified file, and the deleted file can never be restored.

file-url: Name of the file to be deleted including the path. Asterisks (*) are acceptable as wildcards. For example, to remove files with the expansion of txt, you may use the delete * command.

Description

Use the delete command to remove a 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 *.

 

  Caution:

If you delete two files in different directories but with the same filename, only the last one is retained in the recycle bin.

 

Example

# Remove file tt.cfg from the root directory.

<Sysname> delete tt.cfg

Delete flash:/tt.cfg?[Y/N]:y

...

%Delete file flash:/tt.cfg...Done.

1.1.4  dir

Syntax

dir [ /all | file-url ]

View

User view

Parameter

/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 remove files with the .txt extension, you may use the delete * 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.

Example

# 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.bin]

 

15240 KB total (5096 KB free)

1.1.5  execute

Syntax

execute filename

View

System view

Parameter

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.

Example

# Execute the batch file test.bat in the root directory.

<Sysname> system-view

[Sysname] execute test.bat

1.1.6  file prompt

Syntax

file prompt {alert | quiet }

View

System view

Parameter

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.

Example

# Set the file operation prompt mode to alert.

<Sysname> system-view

[Sysname] file prompt alert

1.1.7  fixdisk

Syntax

fixdisk device

View

User view

Parameter

device: Device name.

Description

Use the fixdisk command to restore the space of a storage device when it becomes unavailable because of some abnormal operation.

Example

# Restore the space of the Flash.

<Sysname> fixdisk flash:

Fixdisk flash: may take some time to complete.

%Fixdisk flash: completed.

1.1.8  format

Syntax

format device

View

User view

Parameter

device: Device name.

Description

Use the format command to format a storage device.

 

  Caution:

Formatting a device results in loss of all the files and these files cannot be restored. In particular, if you format the flash, the configuration file on it will be removed.

 

Example

# Format the Flash.

<Sysname> format flash:

All data on flash: will be lost , proceed with format ? [Y/N]:y

./

%Format flash: completed.

1.1.9  mkdir

Syntax

mkdir directory

View

User view

Parameter

directory: Name of 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.

Example

# Create a directory named test.

<Sysname> mkdir ddtest

...

% Created dir flash:/ddtest

# create a subdirectory named mytest under test.

<Sysname>mkdir test/mytest

...

%Created dir flash:/test/mytest

1.1.10  more

Syntax

more file-url

View

User view

Parameter

file-url: File name.

Description

Use the more command to display the contents of the specified file.

So far, this command displays the file in the format of text.

Example

# 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.

1.1.11  move

Syntax

move fileurl-source fileurl-dest

View

User view

Parameter

fileurl-source: Name of the source file.

fileurl-dest: Name of the target file.

Description

Use the move command to move a file.

If the name of the target file is the same as an existing one in the intended directory, the system will ask you whether to overwrite the existing one.

Example

# 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

1.1.12  pwd

Syntax

pwd

View

User view

Parameter

None

Description

Use the pwd command to display  the current path.

If the current path is not set, the operation will fail.

Example

# Display the current path.

<Sysname> pwd

flash:

1.1.13  rename

Syntax

rename fileurl-source fileurl-dest

View

User view

Parameter

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.

Example

# Rename the file sample.txt to 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.

1.1.14  reset recycle-bin

Syntax

reset recycle-bin [ file-url ] [ /force ]

View

User view

Parameter

file-url: Name of the file to be deleted. This argument accepts asterisks (*) as wildcards. For example, you may perform reset recycle-bin *.txt to delete all files with the .txt extension from the recycle bin.

/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.

Example

# 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...

1.1.15  rmdir

Syntax

rmdir directory

View

User view

Parameter

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 subdirectories under it with the delete command.

Example

# Remove directory mydir.

<Sysname> rmdir mydir

Rmdir flash:/mydir?[Y/N]:y

.

%Removed directory flash:/mydir.

1.1.16  undelete

Syntax

undelete file-url

View

User view

Parameter

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 has already existed under the same path, the undelete operation will cause it to be overwritten and the system will ask you whether to continue.

Example

# Restore file sample.bak from the recycle bin.

<Sysname> undelete sample.bak

Undelete flash:/sample.bak ?[Y/N]:y

%Undeleted file flash:/sample.bak.

1.2  File Management Configuration Commands

1.2.1  backup startup-configuration

Syntax

backup startup-configuration to dest-addr [ dest-filename ]

View

Use view

Parameter

dest-addr: IP address or name of a TFTP server. The address cannot be an IPv6 address.

dest-filename: Filename used to save the next startup configuration file on the server.

Description

Use the backup startup-configuration command to backup the main startup configuration file (for next startup) using a filename you specify. If you do not specify this filename, the original filename will be used.

Presently, the device uses TFTP to implement backup operation.

Example

# Backup the main 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>

1.2.2  display saved-configuration

Syntax

display saved-configuration [ by-linenum ]

View

Any view

Parameter

by-linenum: Identifies each line of displayed information with a line number.

Description

Use the display saved-configuration command to display the configuration file saved in the storage device.

In case the device malfunctions after being powered up, you may use this command to identify the problem.

If you do not use the configuration file when the device starts up, no startup configuration file information is displayed after you execute the display startup command, and 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 saved in the configuration file the last time is displayed.

Related command: save, reset saved-configuration, and the display current-configuration command in Basic System Configuration and Maintenance Command Module.

Example

# Display the configuration file saved in the Flash.

<Sysname>display saved-configuration

#

 sysname Sysname

#

 domain default enable system

#

 telnet server enable

#

vlan 1

#

vlan 3000

#

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

#

acl number 2000

 rule 0 deny

#

acl number 3000

 rule 0 permit ip

#

acl number 4000

#

acl ipv6 number 2000

 rule 0 permit source 2001::2/64

#

interface NULL0

#

interface LoopBack0

#

interface Vlan-interface1

 ip address 192.168.0.52 255.255.0.0

#

interface Vlan-interface3000

 ip address 30.1.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

#

interface GigabitEthernet1/0/2

#

interface GigabitEthernet1/0/3

#

interface GigabitEthernet1/0/4

#

interface GigabitEthernet1/0/5

#

interface GigabitEthernet1/0/6

#

interface GigabitEthernet1/0/7

#

interface GigabitEthernet1/0/8

#

interface GigabitEthernet1/0/9

#

interface GigabitEthernet1/0/10

#

interface GigabitEthernet1/0/11

#

interface GigabitEthernet1/0/12

#

interface GigabitEthernet1/0/13

#

interface GigabitEthernet1/0/14

#

interface GigabitEthernet1/0/15

#

interface GigabitEthernet1/0/16

#

interface GigabitEthernet1/0/17

#

interface GigabitEthernet1/0/18

#

interface GigabitEthernet1/0/19

#

interface GigabitEthernet1/0/20

#

interface GigabitEthernet1/0/21

#

interface GigabitEthernet1/0/22

#

interface GigabitEthernet1/0/23

#

interface GigabitEthernet1/0/24

#

interface GigabitEthernet1/0/25

 shutdown

#

interface GigabitEthernet1/0/26

 shutdown

#

interface GigabitEthernet1/0/27

 shutdown

#

interface GigabitEthernet1/0/28

 shutdown

#

user-interface aux 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.

1.2.3  display startup

Syntax

display startup

View

User view

Parameter

None

Description

Use the display startup command to display the configuration file used at this startup and the one used for next startup.

Related command: startup saved-configuration.

Example

# Display the configuration file used at this startup and the one used for next startup

<Sysname> display startup

  Current startup saved-configuration file:          flash:/config.cfg

  Next main startup saved-configuration file:        flash:/config.cfg

  Next backup startup saved-configuration file:      NULL

1.2.4  reset saved-configuration

Syntax

reset saved-configuration [ main | backup ]

View

User view

Parameter

main: Erases the main configuration file.

backup: Erases the backup configuration file.

Description

Use the reset saved-configuration command to erase the configuration file saved in the storage device.

If you do not specify the main/backup parameter, you will erase, by default, the main configuration file.

 

  Caution:

This command will permanently delete the configuration file on the device.

 

In case no configuration file is available, the device starts up with the default settings.

Related command: save, display saved-configuration.

Example

# Erase the configuration file saved in the storage device.

<Sysname> reset saved-configuration backup

The saved configuration will be erased.

Are you sure? [Y/N]:y

Configuration in the device is being cleared.

Please wait .......

Configuration in the device is cleared.

1.2.5  restore startup-configuration

Syntax

restore startup-configuration from src-addr src-filename

View

Use view

Parameter

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 as the main configuration file 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.

Example

# 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!

1.2.6  save

Syntax

save [ file-name | [ safely ] [ main | backup ] ]

View

Any view

Parameter

file-name: File name, whose extension must be .cfg.

safely: Sets the configuration saving mode to safe. Executing the command without the safely keyword is fast, but the file cannot survive a reboot or power-off during saving operation.

main: Save the configuration as the main configuration file.

backup: Save the configuration as the backup configuration file.

Description

Use the save command to save the current configuration to the specified file, or if no filename is specified, to the default file at the root directory.

l           The command saves the current configuration to the main configuration file if the main or backup parameters are not specified.

l           If you specified a filename, but the filename does not exist, the system will create this file and save the configuration into this file. The file attribute is neither main or backup.

l           If you specified a filename and this file exists, the system will save the configuration into this file. The file attribute is the original attribute of the file.

Related command: reset saved-configuration, display current-configuration, display saved-configuration.

Example

# Save the current configuration to the file named test.cfg

<Sysname> save test.cfg

The current configuration will be saved to flash:/test.cfg [Y/N]:Y

Now saving current configuration to the device.

Saving configuration flash:/test.cfg. Please wait...

......

Configuration is saved to flash successfully.

<Sysname>

# Save the current configuration to the backup configuration file

<Sysname> save backup

The current configuration will be written to the device.

Are you sure?[Y/N]:Y

Please input the file name(*.cfg)[flash:/backup.cfg](To leave the

existing filename unchanged, press the enter key):test.cfg

 

Validating file. Please wait...

Now saving current configuration to the device.

Saving configuration flash:/test.cfg. Please wait...

..

Configuration is saved to flash successfully.  

<Sysname>

1.2.7  startup saved-configuration

Syntax

startup saved-configuration cfgfile [ main | backup ]

undo startup saved-configuration

View

User view

Parameter

cfgfile: Configuration file name.

main: Sets the configuration file as main configuration file.

backup: Sets the configuration file as backup configuration file.

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.

This command erases the attribute but without deleting the file.

The specified file must be ended with a .cfg extension and saved in the root directory of the storage device.

The follow cases exist when using this command to specify a configuration file for next startup:

l           With a normal configuration file, after executing the startup saved-configuration cfgfile main command, the configuration file becomes a main configuration file.

l           With a normal configuration file, after executing the startup saved-configuration cfgfile backup command, the configuration file becomes a backup configuration file.

l           With a main configuration file, after executing the startup saved-configuration cfgfile backup command, the configuration file has both main and backup attributes.

l           With a backup configuration file, after executing the startup saved-configuration cfgfile main command, the configuration file has both main and backup attributes.

l           If main/backup attribute is not specified, the file is set as a configuration file.

l           If a main configuration file already exists when setting a new file as the main configuration file, the main attribute of the existing file will be erased to allow only one main configuration file in the system.

l           If a main configuration file already exists when setting a new file as the backup configuration file, the backup attribute of the existing file will be erased to allow only one backup configuration file in the system.

Related command: display startup.

Example

# Specify a backup configuration file for next startup.

<Sysname> startup saved-configuration config.cfg backup

Please wait......Done!

 


Chapter 2  FTP Configuration Commands

2.1  FTP Server Configuration Commands

2.1.1  display ftp-server

Syntax

display ftp-server

View

Any view

Parameter

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.

Example

# 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 login user; now one logged-in user is present; timeout of the user is 30 minutes, and FTP put mode is fast.

2.1.2  display ftp-user

Syntax

display ftp-user

View

Any view

Parameter

None

Description

Use the display ftp-user command to display the parameter settings of current FTP users.

Example

# Display the parameter settings of FTP users.

<Sysname> display ftp-user

  UserName             HostIP    Port    Idle              HomeDir

     user1         10.110.3.5    2804       1         flash:/user1

2.1.3  ftp server enable

Syntax

ftp server enable

undo ftp server

View

System view

Parameter

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.

Example

# Disable the FTP server.

<Sysname>system-view

[Sysname] undo ftp server

% Close FTP server

2.1.4  ftp timeout

Syntax

ftp timeout minute

undo ftp timeout

View

System view

Parameter

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 or aborted, 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 disconnect if no command is received or/and transmitted before the timer expires.

Example

# Set the idle-timeout timer to 36 minutes.

<Sysname> system-view

[Sysname] ftp timeout 36

2.1.5  ftp update

Syntax

ftp update { fast | normal }

undo ftp update

View

System view

Parameter

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.

The FTP server has two modes to update files when you upload files (use the put command) to the FTP server:

l           Fast update mode, that is, the FTP server first receives all the uploaded files to the memory, and then writes the files into the Flash memory of the device. In this mode, even if exceptional situations such as power failure occur on the FTP client during the file transfer process, the files on the FTP server will not be corrupted.

l           Normal update mode, that is, the FTP server writes the uploaded files to the Flash memory of the device while receiving the files. In this mode, the files on the server may be corrupted if exceptional situations such as power failure occur. However, compared with the fast update mode, this mode needs less free memory.

Example

# Set the FTP update mode to fast.

<Sysname> system-view

[Sysname] ftp update fast

2.2  FTP Client Configuration Commands

 

&  Note:

l      You must use the ftp command to enter the FTP client view for configurations under this view. For details, refer to 2.2.10  ftp.

l       The prompt information in the examples of this section depends on your FTP server type.

 

2.2.1  ascii

Syntax

ascii

View

FTP client view

Parameter

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.

Example

# Set the file transfer mode to ASCII.

[ftp] ascii

200 Type set to A.

2.2.2  binary

Syntax

binary

View

FTP client view

Parameter

None

Description

Use the binary command to set the file transfer mode to binary (also called flow mode).

FTP uses two modes to transfer files, one is binary mode, which is used to transfer program file; the other is ASCII mode, which is used to transfer text files.

By default, the transfer mode is ASCII mode.

Example

# Set the file transfer mode to binary.

[ftp] binary

200 Type set to I.

2.2.3  bye

Syntax

bye

View

FTP client view

Parameter

None

Description

Use the bye command to disconnect from the remote FTP server and exit to user view.

Example

# Terminate the connection with the remote FTP server and exit to user view.

[ftp] bye

221 Server closing.

 

<Sysname>

2.2.4  cd

Syntax

cd pathname

View

FTP client view

Parameter

pathname: Path name.

Description

Use the cd command to change the current working directory path on the remote FTP server.

You can use this command to access another authorized directory on the FTP server.

Example

# Change the current working directory path to flash:/temp.

[ftp] cd flash:/temp

250 CWD command successful.

2.2.5  cdup

Syntax

cdup

View

FTP client view

Parameter

None

Description

Use the cdup command to exit the current directory and enter the upper directory of the FTP server.

Example

# Change the current working directory path to the upper directory.

[ftp] cdup

200 CDUP command successful.

2.2.6  close

Syntax

close

View

FTP client view

Parameter

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.

Example

# Terminate the connection to the FTP server and remain in FTP client view.

[ftp] close

221 Server closing.

[ftp]

2.2.7  delete

Syntax

delete remotefile

View

FTP client view

Parameter

remotefile: File name.

Description

Use the delete command to delete a file on the remote FTP server.

To do this, you must be a user with the delete permission on the FTP server.

Example

# Delete file temp.c.

[ftp] delete temp.c

250 DELE command successful.

2.2.8  dir

Syntax

dir [ remotefile [ localfile ] ]

View

FTP client view

Parameter

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.

 

&  Note:

The Is command can only display the names of files and directories, whereas the dir command can display other extra information of the files and directories, such as the size, the date they are created.

 

Example

# 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 config.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

2.2.9  disconnect

Syntax

disconnect

View

FTP client view

Parameter

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.

Example

# Disconnect from the remote FTP server but remain in FTP client view.

[ftp] disconnect

221 Server closing.

2.2.10  ftp

Syntax

ftp [ ftp-server [ port ] [ -a source-ip ] ]

View

User view

Parameter

ftp-server: IP address or host name (a string of 1 to 20 characters) of a remote FTP server.

port: Port number of the remote FTP server, ranging from 0 to 65535. The default value is 21.

-a source-ip: Specifies a source IP address for transmitted FTP packets. This source address must be 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 support IPv4 protocols only.

l           If you use this command without specifying any parameters, you will simply enter the FTP client view without log 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.

Example

# Log onto the device with the IP address of 192.168.0.211.

<Sysname> ftp 192.168.0.211

Trying 192.168.0.211 ...

Press CTRL+K to abort

Connected to 192.168.0.211.

220 FTP Service ready...

User(192.168.0.211:(none)):abc

331 Password required for abc

Password:

230 User logged in.

[ftp]

2.2.11  ftp ipv6

Syntax

ftp ipv6 [ ftp-ipv6-server [ port ] [ -a source-ipv6 ] [ -i interface-type interface-number ] ]

View

Use view

Parameter

ftp-ipv6-server: IPv6 address or host name (a string of 1 to 46 characters) of the remote FTP server. The host name, when used, is resolved to the corresponding IPv6 address by the static or dynamic ARP.

port: Port number of the FTP server, ranging from  0 to 65535. The default value is 21.

-a source-ipv6: Specifies a source IP address for transmitted FTP packets. This address must be an IPv6 address that has been configured on the device.

-i interface-type interface-number: Specified the type and number of the egress interface. This parameter must be specified if the destination address is the link local address, and the specified egress interface must have a link local address.

Description

Use the ftp ipv6 command to log onto the FTP server and enter FTP client view.

Note that:

l           This command supports IPv6 protocols only.

l           If you use this command without specifying any parameters, you will simply enter the FTP client view without log 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.

Example

# 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]

2.2.12  get

Syntax

get remotefile [ localfile ]

View

FTP client view

Parameter

remotefile: File name on the remote FTP server.

localfile: Local file name.

Description

Use the get command to FTP a file from a remote 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.

Example

# Download file config.cfg and save it as aa.cfg.

[ftp]get config.cfg aa.cfg

 

227 Entering Passive Mode (192,168,1,50,17,163).

125 ASCII mode data connection already open, transfer starting for config.cfg.

.....226 Transfer complete.

FTP: 5190 byte(s) received in 7.754 second(s), 669.00 byte(s)/sec.

2.2.13  lcd

Syntax

lcd

View

FTP client view

Parameter

None

Description

Use the lcd command to display the local working directory path of the FTP client.

Example

# Display the local working directory path.

[ftp] lcd

FTP: Local directory now flash:/temp

2.2.14  ls

Syntax

ls [ remotefile ] [ localfile ]

View

FTP client view

Parameter

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.

 

&  Note:

The Is command can only display the names of files and directories, whereas the dir command can display other extra information of the files and directories, such as the size, the date they are created.

 

Example

# View the information 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

config.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

2.2.15  mkdir

Syntax

mkdir directory

View

FTP client view

Parameter

directory: Directory name.

Description

Use the mkdir command to create a directory on the remote FTP server.

To do this, you must be a user with the permission on the FTP server.

Example

# Create subdirectory mytest on the current directory of the remote FTP server.

[ftp] mkdir mytest

257 "flash:/mytest" new directory created. 

2.2.16  open

Syntax

open ftp-server [ port ] [ -a source-ip ]

View

FTP client view

Parameter

ftp-server: IP address or host name (a string of 1 to 20 characters) of a remote FTP server.

port: Port number of the remote FTP server, in the range of 0 to 65535, with the default value of 21.

-a source-ip: Specifies a source IP address for transmitted FTP packets. This source address must be one that has been configured on the device.

Description

Use the open command to log onto the IPv4 FTP server under the 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.

This command supports IPv4 protocols.

Related command: close

Example

# Enter FTP client view.

<System> ftp

[ftp]

# Log onto the FTP server with the IP address of 192.168.1.50.

[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]

2.2.17  open ipv6

Syntax

open ipv6 ftp-ipv6-server [ port ] [ -a source-ipv6 ] [ -i interface-type interface-number ]

View

FTP client view

Parameter

ftp-ipv6-server: IPv6 address or host name (a string of 1 to 46 characters) of the remote FTP server.

port: Port number of the remote FTP server, ranging from 0 to 65535. The default value is 21.

-a source-ipv6: Specified the source address of the transmitted FTP packets. This address must be an IPv6 address that has been configured on the device.

-i interface-type interface-number: Specifies the egress interface by it type and number. This parameter must be specified when the destination address is the link local address.

Description

Use the open ipv6 command to log onto IPv6 FTP server in the 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.

This command supports IPv6 protocols.

Related command: close

Example

# Enter FTP client view.

<Sysname> ftp

[ftp]

# Log onto the FTP server (with IPv6 address 3000::200) in the FTP client view.

[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.

2.2.18  passive

Syntax

passive

undo passive

View

FTP client view

Parameter

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.

Example

# Set the data transmission mode to passive.

[ftp] passive

FTP: passive is on

2.2.19  put

Syntax

put localfile [ remotefile ]

View

FTP client view

Parameter

localfile: Source file name.

remotefile: Name of the file to be saved on the remote FTP server.

Description

Use the put command to FTP 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.

Example

# 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.00 byte(s)/sec.

2.2.20  pwd

Syntax

pwd

View

FTP client view

Parameter

None

Description

Use the pwd command to display the working directory on the remote FTP server.

Example

# Display the working directory on the remote FTP server.

[ftp] pwd

257 "flash:/temp" is current directory.

2.2.21  quit

Syntax

quit

View

FTP client view

Parameter

None

Description

Use the quit command to disconnect from the remote FTP server and exit to user view.

Example

# Disconnect from the remote FTP server and exit to user view.

[ftp] quit

221 Server closing. 

<Sysname>

2.2.22  remotehelp

Syntax

remotehelp [ protocol-command ]

View

FTP client view

Parameter

protocol-command: FTP command.

Description

Use the remotehelp command to display the help for FTP commands.

Example

# Display the syntax of the user command.

[ftp] remotehelp user

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 X company.

2.2.23  rmdir

Syntax

rmdir directory

View

FTP client view

Parameter

directory: Directory name on the remote FTP server.

Description

Use the rmdir command to delete a specified directory from the FTP server.

Note that only authorized users are allowed to use this command.

The directory must be an empty one. If it is not, first delete all files under it with the delete command.

Example

# Delete the flash:/temp1 directory from the FTP server.

[ftp] rmdir flash:/temp1

200 RMD command successful.

2.2.24  user

Syntax

user username [ password ]

View

FTP client view

Parameter

username: Username for another login.

password: Login password.

Description

Use the user command to log into the FTP server again using another username after you have logged into the FTP server successfully.

Before you execute this command, you must configure the corresponding username and password used for the new login. Otherwise, the new login will fail and the FTP connection will be disconnected.

Example

# User ftp1 has logged into the FTP server. Now he loggs in the current FTP server again in the name of ftp2 (assume that the username ftp2 and password 123123 have been configured on the FTP server).

[ftp] user ftp2

331 Password required for ftp2.

Password:

230 User logged in.

 

[ftp]

2.2.25  verbose

Syntax

verbose

undo verbose

View

FTP client view

Parameter

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.

Example

# Enable the verbose function.

[ftp] verbose

FTP: verbose is on

 


Chapter 3  TFTP Configuration Commands

3.1  TFTP Client Configuration Commands

3.1.1  tftp-server acl

Syntax

tftp-server [ ipv6 ] acl acl-number

undo tftp-server [ ipv6 ] acl

View

System view

Parameter

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 associate a configured ACL to the TFTP application. You can allow or prohibit the access to a certain TFTP server in the network through the configured rules in the ACL.

Use the undo tftp-server ipv6 acl command to cancel the association between the ACL and TFTP application.

For more information about ACL, refer to ACL Configuration.

Example

# Associate ACL 2000 with the TFTP application in IPv4 network.

<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 ACL 2001 with the TFTP application in IPv6 network.

<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

3.1.2  tftp get

Syntax

tftp tftp-server get source-file [ dest-file | -a source-ip ]*

View

User view

Parameter

tftp-server: IP address or host name of the TFTP server.

get: Downloads a file from the remote TFTP server and saves on local switch..

source-file: Name of the file to be downloaded from the TFTP server.

dest-file: Name of the new file saved on the switch.

-a source-ip: Specifies a source IP address for transmitted TFTP packets. Note that the specified source IP address must has been configured on the switch.

Description

Use the tftp get command to download files from the TFTP server to the local device.

If no destination file name is specified, the saved file uses the source file name.

This command is available in IPv4 networks.

Related command: tftp put, tftp sget.

Example

# Download the LANSwitch.bin file from the TFTP server with the IP address of 192.168.0.98 and save it as vxWorks.bin.

<Sysname> tftp 192.168.0.98 get LANSwitch.bin vxWorks.bin

  File will be transferred in binary mode.

  Downloading file from remote tftp server, please wait......

  TFTP:       35 bytes received in 0 second(s).

  File downloaded successfully.

3.1.3  tftp ipv6

Syntax

tftp ipv6 tftp-ipv6-server [ -i interface-type interface-number ] { get | put } source-file [ destination-file ]

View

User view

Parameter

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 must be specified when the TFTP server is the link local address.

get: Downloads a file.

put: Uploads a file.

source-file: Filename of the source.

destination-file: Filename of the destination. 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 is available in IPv6 networks.

Example

# Download files from TFTP server.

<Sysname> tftp ipv6 fe80::250:daff:fe91:e058 -i Vlan-interface 300 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).

  File downloaded successfully

3.1.4  tftp put

Syntax

tftp tftp-server put source-file [ dest-file ] [ -a source-ip ]*

View

User view

Parameter

tftp-server: IP address or host name (a string of 1 to 20 characters) of a TFTP server.

source-file: Name of the file to be uploaded onto the TFTP server.

dest-file: Filename used to save the uploaded file on the TFTP server.

-a source-ip: Specifies a source IP address for transmitted TFTP packets. This address must one that has been configured on the device.

Description

Use the tftp put command to TFTP a file to a TFTP server.

If no destination file name is specified, the saved file uses the source file name.

This command is available in IPv4 networks.

Related command: tftp get, tftp sget.

Example

# TFTP file config.txt in the root directory to the TFTP server with the IP address of 1.1.1.2 and save it as config.bak under the default path on the server.

<Sysname> tftp 1.1.1.2 put flash:/config.txt  config.bak

  File will be transferred in binary mode.

  Copying file to remote tftp server. Please wait... /

  TFTP:      962 bytes sent in 0 second(s).

  File uploaded successfully.

3.1.5  tftp sget

Syntax

tftp tftp-server sget source-file [ dest-file | -a source-ip ]*

View

User view

Parameter

tftp-server: IP address or host name (a string of 1 to 20 characters) of a TFTP server.

source-file: Source file name, identifies the file to be gotten from the TFTP server.

dest-file: Destination file name, identifies the file to be saved on the local device.

-a source-ip: Specifies a source IP address for transmitted TFTP packets. This source address must be one that has been configured on the device

Description

Use the tftp sget command to securely TFTP a file from a TFTP server.

In this approach, the device starts writing data to the Flash after file transfer completes. If the file is intended to overwrite another file on the device, this can protect the latter from being corrupted in the event that anomalies, power failure for example, occur during file transfer.

When using this approach, you need to ensure that adequate NVRAM space is available.

This command is available in IPv4 networks.

Related command: tftp get, tftp put.

Example

# Download (in save mode) file config.txt from the root directory of the TFTP server (with IP address 1.1.1.1) and save it as config.bak on the server.

<Sysname> tftp 1.1.1.1 sget config.txt flash:/config.bak

  Write file to memory

  Downloading file from remote tftp server, please wait.../

  TFTP:     1868 bytes received in 0 second(s)

  File downloaded successfully.

 

  Writing data into local file, please wait... ...

  Succeed to write data into file .

 


  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网