Say you have a path like this "/some/path/here with spaces/". If you try to transfer it you will get a message along the lines of:
scp -rp 192.168.0.12:"/some/path/here space/" .
scp: /some/path/here: No such file or directory
scp: space: No such file or directory
You can escape each space but what a pain that is especially if you have multiple spaces in the path.
The simplest way is to use the following instead:
scp -rp 192.168.0.12:'"/some/path/here space/"' .
or
scp -rp 192.168.0.12:'"/some/path/here space/"' .
As you can see we are basically padding it with a '" or "' on either side to make the shell interpret it as a literal instead of thinking the space is where the path name ends.
In newer versions you may get this error with the above solution:
protocol error: filename does not match request
To solve it, add the "-T" option:
scp -T -rp 192.168.0.12:'"/some/path/here space/"' .
scp, linux, spacessay, quot, spaces, rp, directory, multiple, simplest, padding, shell, interpret, literal,