I use scp quite a bit. But I never had to use it with directory paths involving spaces until now (for some odd reason, I must be good at naming things as simple as possible, a good habit by the way).

In order to use spaces, as per this article, it is necessary to add three back slashes and the space.

At least that is the easiest way. Take a look at the linked article for more about it.

Here’s an example:

scp -rP 1234 allmy_code/* [email protected]:/srv/Code\\ Version_1/

Mario Loria is a builder of diverse infrastructure with modern workloads on both bare-metal and cloud platforms. He's traversed roles in system administration, network engineering, and DevOps. You can learn more about him here.