FAQs about SCP
zsh report errors no matches found while zsh uses scp to transfer files with wildcards
scp [email protected]:/Users/cloudolife/.ssh/* ~/.ssh/
The reason is because zsh tries to expand *. No matches error will be reported when the file cannot be found locally.
There are two approaches:
Option 1, Avoid zsh to expand *
Add a backslash() before * to prevent escaping
scp [email protected]:/Users/cloudolife/.ssh\* ~/.ssh/
Or, Enclose the path (or the path including the server) with single or double quotes
But sometimes the above two methods using wildcards for local paths are invalid, then refer to next:
Option 2, Switch to /bin/bash
/bin/bash does not have the problem of expanding *.
chsh -s /bin/bash