I want to send the following files from my computer to a remote computer using scp.

Directory1
  File1
  File2
  Directory2
    File3
    File4
    ...

How can I send File1, File2, etc. such that they are saved to the same directories on the remote computer as they are on my computer (e.g. Directory1 and Directory2 are created on the remote computer and Directory2 contains File3 and File4)?

有帮助吗?

解决方案

Copy the directory "foo" from the local host to a remote host's directory "bar"

scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

The -r tells it to copy recursively.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top