2.4 Transfer Files Using scp

Use scp to copy files securely between the local computer and a remote host, or to transfer files securely between two remote hosts. The basic syntax is:

scp [[user@]host[#port]:]source [[user@]host[#port]:]destination

Both source and destination file names can include host and user specification to indicate that files are to be copied to or from that host.

To copy a local file to the default remote directory

  • Use the following example to get started:

    scp file_src joe@myhost.com:

To copy remote files to the local working directory

  • Use the following example to get started:

    scp joe@myhost:/demo*.htm .

For additional examples, see Secure File Copy. For detailed information about command line options, see scp Command Line Options.