scp all files starting with 'file' from a server

Lahniep picture Lahniep · Mar 27, 2010 · Viewed 17.4k times · Source

I use this command to copy all files whose names start with 'file' from a server. scp -vp me@server:/location/files* ./

But i got a 'No Match' error. probably Concerning the '' in the command. How can i protect the '' for ssh to understand that this refers to a list of files and not taking it as a filename.

Thx August

Answer

Brian Agnew picture Brian Agnew · Mar 27, 2010

The shell itself is expanding the *. You can escape this by quoting it or using backslashes to prevent the shell interpreting it and instead passing it directly to scp:

scp -vp me@server:/location/files\*