我希望能够将目录及其所有文件从本地计算机传输到远程计算机。我不使用SCP,所以有点困惑。
我通过ssh连接到远程计算机,并输入了命令
scp name127.0.0.1:local/machine/path/to/directory filename
这local/machine/path/to/directory
是我pwd
在本地主机上所需目录中使用时获得的值。
我目前遇到错误
No such file or directory
看起来您正在尝试使用该命令复制到本地计算机。
一个示例scp看起来更像下面的命令:
将文件“ foobar.txt”从本地主机复制到远程主机
$ scp foobar.txt [email protected]:/some/remote/directory
scp“ the_file” your_username @ the_remote_host:the / path / to / the /目录
发送目录:
将目录“ foo”从本地主机复制到远程主机的目录“ bar”
$ scp -r foo [email protected]:/some/remote/directory/bar
scp -r“ the_directory_to_copy” your_username @ the_remote_host:the / path / to / the / directory / to / copy / to
并从远程主机复制到本地:
将文件“ foobar.txt”从远程主机复制到本地主机
$ scp [email protected]:foobar.txt /your/local/directory
scp your_username @ the_remote_host:the_file /您的/本地/目录
并包括端口号:
将文件“ foobar.txt”从具有端口8080的远程主机复制到本地主机
$ scp -P 8080 [email protected]:foobar.txt /your/local/directory
scp -P port_number your_username @ the_remote_host:the_file /您的/本地/目录
pscp -r <directory_to_copy> username@remotehost:/path/to/directory/on/remote/host
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句