scp from remote Linux to local Windows with spaces in local path
Try using
quotes '
orDouble quotes "
around complete argument.As suggested by @dirkt in comments Quoting the complete path argument for the ssh host should do the work. That makes your command like this :
scp /home/user.name/file.html '[email protected]:/C:/Users/user.name/test folder/'
Use
escape sequence for space
in between name of folder.You can use
\
(backslash with a space) that is escape sequence for a space. That makes your command like this :scp /home/user.name/file.html '[email protected]:/C:/Users/user.name/test\ folder/'
Notice the
\
with a space in betweentest
&folder
that makes ittest\ folder
.It maybe the case that you
need to escape twice
as It is escaped first locally and then on the remote end. In that case you can write like this :"'complete argument'"
inside quotes within double quotes like this :"'[email protected]:/C:/Users/user.name/test folder/'"
OR
Escape spaces and quote complete argument like this :
'[email protected]:/C:/Users/user.name/test\ folder/'
OR
Escape twice directly using escape sequence like this
[email protected]:/C:/Users/user.name/test\\ folder/
Feel free to add-in more details.