Copying a file from a remote host to a local host
Use the ftp command to copy a file from a remote host to a local host.
To copy a file from a remote host to a local host using the ftp command, you must first log in to the remote system either directly or indirectly. See Logging in to a remote host directly or Logging in to a remote host indirectly for instructions.
Note: The ftp command uses the ASCII default transfer type to copy files.
To copy a file from a remote host to a local host:
- Determine if the file that you want to copy is in the current directory
by running the dir subcommand. (The dir subcommand for the ftp command works in the same way as the ls -l command.) If the file is not there, use the cd subcommand to move to the proper directory.
- To copy your local file using binary image, type:
- To copy a file to your host, type:
The file is placed in the directory from which you issued the ftp command.
- To end the session, press the Ctrl-D key sequence, or type quit.