135
Examples
# Access the test directory after logging in to the device.
<Sysname> cd test
# Change to the parent directory.
<Sysname> cd ..
copy
Use copy to copy a file.
Syntax
copy source-file { dest-file | dest-directory }
Views
User view
Predefined user roles
network-admin
Parameters
source-file: Specifies the name or URL of the file to be copied in non-FIPS mode, and specifies the
name of the file to be copied in FIPS mode. If the file resides on an FTP, TFTP, or HTTP server rather
than on the device, specify the URL of the file. Whether a URL is case sensitive depends on the
server.
dest-file: Specifies the name or URL for the destination file in non-FIPS mode, and specifies the
name for the destination file in FIPS mode. To copy the source file to an FTP, TFTP, or HTTP server,
specify a URL. Whether a URL is case sensitive depends on the server.
dest-directory: Specifies the destination directory or URL in non-FIPS mode, and specifies the
destination directory in FIPS mode. To copy the source file to an FTP, TFTP, or HTTP server, specify
a URL. The device copies the source file to the destination location and saves the file with its original
file name. Whether a URL is case sensitive depends on the server.
Usage guidelines
In FIPS mode, the copy command can only copy a local file and save it locally.
In non-FIPS mode, you can use the copy command to perform the following tasks:
• Copy a local file and save it locally.
• Copy a local file and save it to an FTP, TFTP, or HTTP server.
• Copy a file from an FTP, TFTP, or HTTP server and save it locally.
To specify a file or directory, use the following guidelines:
Location Name format Remarks
On the device
Use the file name guidelines in
Fundamentals Configuration
Guide.
N/A
On an FTP
server
Enter the URL in the format of
ftp://
FTP
username[
:
password]
@
server
address[
:
port number]
/
file
path[
/
file name].
The username and password must be the same as the
username and password configured on the FTP
server. If the server authenticates users only by the
username, you are not required to enter the password.
For example, to use the username a and password 1
and specify the startup.cfg file in the authorized
working directory on the FTP server 1.1.1.1, enter
ftp://a:1@1.1.1.1/startup.cfg.