我在遥控器中remote_host
有一个像这样的文件:
\home\user\path with spaces\filename with spaces.ext
我想要scp
它到当前目录.
。我怎样才能做到这一点?
谢谢!
经过调查,我发现了以下两种选择:
scp 'user@remote_host:"/home/user/path with spaces/filename with spaces.ext"' .
和
scp 'user@remote_host:/home/user/path\ with\ spaces/filename\ with\ spaces.ext' .
希望对您有帮助!
玩得开心!
编辑-openssh已更新为具有安全功能,该功能会导致路径名中的某些字符出现错误消息“协议错误:文件名与请求不匹配”。在这种情况下,使用scp的新-T
选项将使其工作。例如
scp -T 'user@remote_host:"/home/user/path with spaces/filename with spaces and (2018).ext"' .
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句