How to use wildcards (*) when copying with scp

puttyscpwildcards

Why can't I copy with scp when I'm using * characters in the path?

scp SERVERNAME:/DIR/* .

What configuration does SCP need in order to allow * in the path?

UPDATE: the problem is not on server side; pscp is trying to use SCPv1, and that's why the error message:

scp commandline and error message regarding a file called *

Best Answer

You need to pass a literal escape to scp to avoid the remote machine treating * as a glob (notice that it is doubly quoted):

scp 'SERVERNAME:/DIR/\*' .
Related Question