Mac OS X 上的 scp 问题:scp 不喜欢文件名中的空格,“\”修复不起作用
我正在尝试使用 scp 在两台 Mac(操作系统 10.6.8)之间传输文件。但它失败了,因为我的目录/文件名中有空格。我无法更改目录/文件名。
当我使用 Mac 在终端中工作时,我经常使用 \ 符号来表示空格。然而,在这种情况下,它不起作用。我非常感谢有关如何处理此问题的任何提示。谢谢。
这是我正在做的一个例子,以防我在某个地方犯了一个愚蠢的错误:
scp -r me@myWork:../../My\ documents/Projects/Project\ 1/* ./Desktop
Error: scp: ../../My: No such file or directory
我也尝试了 rsync,但这也不起作用:
rsync -avub -e ssh me@myWork::../../My\ documents/Projects/Project\ 1/* ./Desktop
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-40/rsync/io.c(452)
I am trying to use scp to transfer files between two Macs (OS 10.6.8). But it fails because there are spaces in my directory/file names. I can't change the directory/file names.
I have often used a \ symbol when working in a terminal with my Macs to represent spaces. In this case, however, it is not working. I would very much appreciate any tips on how to deal with this. Thanks.
Here is an example of what I'm doing, in case I'm making a silly mistake somewhere:
scp -r me@myWork:../../My\ documents/Projects/Project\ 1/* ./Desktop
Error: scp: ../../My: No such file or directory
I tried rsync too and that doesn't work either:
rsync -avub -e ssh me@myWork::../../My\ documents/Projects/Project\ 1/* ./Desktop
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-40/rsync/io.c(452)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对我来说,我实际上需要同时做这两件事:
for me I needed to actually do both:
这适用于 10.14.5 Mojave 和 10.15.7 Catalina
注意:
源路径具有
“Provisioning\ Profiles”
目标路径具有
“配置配置文件”
This worked for 10.14.5 Mojave and 10.15.7 Catalina
Note:
the source path has
"Provisioning\ Profiles"
the destination path has
"Provisioning Profiles"
你没有逃出“我的”后面的空格。这:
应该是:
或者您可以将整个路径用引号引起来。
You didn't escape the space after "my". This:
should be:
Or you could just wrap the entire path in quotes.