0

I have ran into an issue where I cannot use scp from my Mac laptop to copy files from my Windows PC.

The command I am running on MacOS: scp user@pcname:\Users\Will\treemnger\ Documents/treemnger*

It returns the same output as scp --help.

*'user' and 'pcname' are placeholders

  • I'm not giving a full answer because I don't know pitfalls of using scp on Windows, but locally on Mac there are problems: (1) Unquoted backslashes escape characters that immediately follow, including the space. No backslash gets to scp. Single-quote. (2) Unquoted asterisk can trigger filename generation. // My guess is you're passing one argument to scp, where you need at least two. Don't you want scp -r? If the asterisk is supposed to be in the second argument then it doesn't make sense. – Kamil Maciorowski Apr 19 '21 at 18:10
  • scp -r 'user@pcname:\Users\Will\treemnger\' 'Documents/treemnger/' makes more sense. But because of how scp works (see the beginning of this answer) a shell command will be invoked on the remote side. The path will be digested again. If the shell there is sh-like then it will treat the backslashes again as escape characters. If it's cmd.exe-like then it's different. scp on the remote side may interpret on its own. It may expect pathnames with backslashes or with slashes. That's why I cannot give you a command that will work with Windows for sure. – Kamil Maciorowski Apr 19 '21 at 19:08
  • Have you tried using forward slashes like this: scp user@pcname:/Users/Will/treemnger/ Documents/treemnger/? That said, the command will fail because, as already commented above, the copies the contents of a folder, which requires a -r switch in scp like this: scp -r. – jaume Apr 20 '21 at 10:14

0 Answers0