Handling spaces in filenames

Larry Alkoff labradley at mindspring.com
Wed Aug 12 17:07:25 MDT 2009

Matthias Schniedermeyer wrote:
> On 11.08.2009 21:04, Larry Alkoff wrote:
>> Man rsync says that
>> "If  you  need  to  transfer  a  filename that contains whitespace,  
>> you'll need to either escape the whitespace in a way that the remote  
>> shell will understand, or  use  wildcards in place of the spaces.".
>> I am regularly doing backups with rsync and notice that files names with  
>> a space in them copy properly, without any special escape or other  
>> characters.
>> Is this a change in rsync?
>> Is the warning in the man page no longer needed?
>> I will say that my 'filenames' with spaces are mostly (if not all)  
>> directory names so perhaps rsync knows to handle directory names better
>> than file names.
> It only refers to white-spaces directly in the commandline, nothing
> else.
> You to "protect" things like this:
> rsync <whatever> "source dir/" "target dir/" (Local, nothing special)
> rsync <whatever> "source dir/" "destination:target\ dir/" (Remote space has to be "protected")
> or
> rsync <whatever> --protect-args "source dir/" "destination:target dir/"
> (Same as before, but rsync does the protecting itself)
> Bis denn

Hello Matthias

Thanks very much for your concise and crystal clear explanation.

"It only refers to white-spaces directly in the commandline, nothing else."

So it is written, so shall it be.


More information about the rsync mailing list