问题描述
我希望能够将目录及其所有文件从本地计算机传输到远程计算机.我不怎么使用SCP所以我有点困惑.
I want to be able to transfer a directory and all its files from my local machine to my remote one. I dont use SCP much so I am a bit confused.
我通过 ssh 连接到我的远程机器并输入了命令
I am connected to my remote machine via ssh and I typed in the command
scp name127.0.0.1:local/machine/path/to/directory filename
local/machine/path/to/directory
是我在本地主机上的所需目录中使用 pwd
获得的值.
the local/machine/path/to/directory
is the value i got from using pwd
in the desired directory on my local host.
我目前收到错误
没有那个文件或目录
推荐答案
看起来您正在尝试使用该命令复制到本地计算机.
Looks like you are trying to copy to a local machine with that command.
一个示例 scp 看起来更像下面的命令:
An example scp looks more like the command below:
将文件foobar.txt"从本地主机复制到远程主机
Copy the file "foobar.txt" from the local host to a remote host
$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory
scp "the_file" your_username@the_remote_host:the/path/to/the/directory
发送目录:
将目录foo"从本地主机复制到远程主机的目录bar"
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
scp -r "the_directory_to_copy" your_username@the_remote_host:the/path/to/the/directory/to/copy/to
并从远程主机复制到本地:
and to copy from remote host to local:
将文件foobar.txt"从远程主机复制到本地主机
Copy the file "foobar.txt" from a remote host to the local host
$ scp your_username@remotehost.edu:foobar.txt /your/local/directory
scp your_username@the_remote_host:the_file/your/local/directory
并包括端口号:
将foobar.txt"文件从远程主机的8080端口复制到本地主机
Copy the file "foobar.txt" from a remote host with port 8080 to the local host
$ scp -P 8080 your_username@remotehost.edu:foobar.txt /your/local/directory
scp -P port_number your_username@the_remote_host:the_file/your/local/directory
pscp -r username@remotehost:/path/to/directory/on/remote/host
这篇关于从本地到远程机器的 scp 文件错误:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!