The examples in this section assume that the following host entries have been defined in the host table:
Example 1
Copy a remote file to a local file by using the CLI file copy command format. The following command creates or replaces the local file autocfg.scr by copying the remote file autocfg.scr located in the directory ftpDir/scripts on the host mary. The username mike and password mikePwd from the host entry mary are used to access the remote file.
- copy mary:ftpDir/scripts/autocfg.scr autocfg.scr
Example 2
Copy a local file to a remote fileby using file copy command format. The following command creates or replaces the remote file shConfigForJoe.txt in the directory ftpDir/results on the host joe by copying the local file shConfig.txt. The username joe and password jPasswd from the host entry joe are used to access the remote file.
- copy shConfig.txt joe:ftpDir/results/shConfigForJoe.txt
Example 3
Copy a remote file to a local file by using the URL format, use the hostname to specify the location, and specify the user name and password in the command. The following command creates or replaces the local file autocfg.scr by copying the remote file autocfg.scr located in the directory ftpDir/scripts on the host mary. The username fred and the password passwd in the command are used; the username and password in the host entry are ignored.
- copy ftp://fred:passwd@mary/ftpDir/scripts/autocfg.scr
autocfg.scr
Example 4
Copy a remote file to a local file by using the URL format, use the hostname to specify the location, specify the user name in the command, and use the default value of the password. The following command creates or replaces the local file autocfg.scr by copying the remote file autocfg.scr located in the directory ftpDir/scripts on the host mary. The username fred from the command and the default password null are used; the username and password in the host entry are ignored.
- copy ftp://fred@mary/ftpDir/scripts/autocfg.scr autocfg.scr
Example 5
Copy a remote file to a local file by using the URL format, and use the hostname to specify the location. The protocol TFTP, which does not support usernames or passwords, is the protocol in the URL. The following command creates or replaces the local file autocfg.scr by copying the remote file autocfg.scr located in the directory ftpDir/scripts on the host mary. The protocol specified in the command is used; the protocol for the host entry mary is ignored.
- copy tftp://mary/ftpDir/scripts/autocfg.scr autocfg.scr
Example 6
Copy a remote file to a local file by using the URL format, use the hostname to specify the location, and use the username and password from the host entry. The following command creates or replaces the local file autocfg.scr by copying the remote file autocfg.scr located in the directory ftpDir/scripts on the host mary. The username mike and password mikePwd from the host entry are used.
- copy ftp://mary/ftpDir/scripts/autocfg.scr autocfg.scr
Example 7
Copy a remote file to a local file by using the URL format. Use the host's IP address to specify the location. The following command creates or replaces the local file autocfg.scr by copying the remote file autocfg.scr located in the directory ftpDir/scripts on the host 172.28.32.156. Use the username fred to access the remote file.
- copy ftp://fred@172.28.32.156/ftpDir/scripts/autocfg.scr
autocfg.scr
Example 8
Copy a local file to a remote file by using the URL format, and use the host's IP address to specify the location. The following command creates or replaces the remote file shConfigJoe.txt in the directory ftpDir/results on the host 172.28.32.156 by copying the local file shConfig.txt. The username joe and the password passwd from the command are used to access the remote file.
- copy shConifg.txt ftp://joe:passwd@172.28.32.156/ftpDir/results/shConfigJoe.txt
Example 9
Redirect the output of a command to a remote file by using the URL format, and use the host's IP address to specify the location. Execute show config, and redirect the output to the remote file shConfigJoe.txt in directory ftpDir/results on host 172.28.32.156 using username joe and password passwd.
- show config > ftp://joe:passwd@172.28.32.156/ftpDir/results/shConfigJoe.txt