03-File System Management Command

Download

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