开发者

Problem with scp on Mac OS X: scp doesn't like spaces in filenames, "\" fix doesn't work

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\ documen开发者_JAVA百科ts/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)


for me I needed to actually do both:

scp -r 127.0.0.1:/Volumes/Folders/Faces/"Why\ Spaces\ Why"/"Insanity\ Rules"/ .


This worked for 10.14.5 Mojave and 10.15.7 Catalina

scp -r abc@x.x.x.x:~/Library/MobileDevice/"Provisioning\ Profiles"/. ~/Library/MobileDevice/"Provisioning Profiles"/.

Note:

the source path has "Provisioning\ Profiles"

the destination path has "Provisioning Profiles"


You didn't escape the space after "my". This:

me@myWork:../../My documents/Projects/Project\ 1/*

should be:

me@myWork:../../My\ documents/Projects/Project\ 1/*

Or you could just wrap the entire path in quotes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜