如何使用scp命令将文件/文件夹从windows复制到linux (putty)?
我使用了scp user@hostname(windows):c:\folder\filname user@hostname(Linux):/folder/filename(destination),,但意外的是我得到了一个错误。
基本上,我是在尝试从windows复制到Linux。无论我是在windows上还是在Linux上,我都希望它能工作。
发布于 2013-11-13 14:34:55
我不认为这可以在这种形式下工作,使用反斜杠\分隔符:
scp user@hotname:c:\folder\filname user@hostname:\folder\filename(destination)首先,Linux中的路径分隔符是/而不是\,所以这样会更好:
scp user@hotname:c:\folder\filname user@hostname:/folder/filename其次,您的命令看起来就像是在第三台PC上运行此命令,在machineC上将文件从machineA复制到machineB。如果情况并非如此,并且您实际上正在使用machineA将文件复制到machineB,那么这样做会更好:
scp c:\folder\filname user@hostname:/folder/filename更新
如果你在Windows中没有scp命令,这里有几个选项:
scp toopscp.exe代替scp,上面的语法将work.发布于 2013-11-13 14:10:29
如果你想用scp把文件从windows拷贝到linux,你必须使用Winscp http://www.siteground.com/tutorials/ssh/ssh_winscp.htm,这个链接会很有帮助。
感谢和问候,
阿洛克·塔克
发布于 2018-06-13 05:46:43
在*nix系统中,这应该是可行的:
# to copy file.ext from remote server to current working directory
# note the dot (.) at the end, which means current directory
$ scp user@remote.server.com:~/desired/folder/file.ext .
# to copy all files in a folder from remote server
# to current directory
# note the dot (.) at the end, which means current directory
$ scp -r user@remote.server.com:~/desired/folder/* .
# copy a folder and all its contents as it is from remote server
# to current directory
# note the dot (.) at the end, which means current directory
$ scp -r user@remote.server.com:~/dersired/folder .更多信息也可以在本文中找到:scp command syntax
https://stackoverflow.com/questions/19945881
复制相似问题