Bo's blog

Thursday, October 13, 2011

How to SCP a path with spaces


These instructions are assuming you're connecting from a unix-like system to a unix-like system (eg Linux or OSX).
scp -r myserver.com:"/path/with/a/Space\\ In\\ It" ./
This basically says "recursively copy the folder at myserver.com (using the local username) to the current folder using scp". Now the spaces need to be double escaped as the first escape only signifies that they're spaces on the LOCAL machine - by the time they got to the remote machine, they wouldn't be escaped anymore. By double escaping them locally, by the time the path makes it to the remote machine they are just single escaped.

0 Comments:

Post a Comment

<< Home