The problem with scp on Mac OS X: scp does not like spaces in file names, the "\" fix does not 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 cannot change directory / file names.

I often used the \ character when working in a terminal with my Mac to represent spaces. In this case, however, it does not work. I would really appreciate any advice on how to deal with this. Thank you

Here is an example of what I'm doing, in case I make a stupid mistake:

scp -r me@myWork :../../My\ documents/Projects/Project\ 1/* ./Desktop Error: scp: ../../My: No such file or directory 

I tried rsync too, and this 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) 
+7
source share
3 answers

You could not escape the space after "mine." It:

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

it should be:

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

Or you can just wrap it all in quotation marks.

-1
source

for me I needed to do both:

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

This worked for macOS Mojave 10.14.5

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

Remarks:

source path has "Provisioning\ Profiles"

destination path has "Provisioning Profiles"

0
source

Source: https://habr.com/ru/post/892783/


All Articles