Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scp all files starting with 'file' from a server [closed]

Tags:

scp

ssh

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

like image 820
Lahniep Avatar asked Mar 27 '10 10:03

Lahniep


People also ask

Can you SCP an entire directory?

To copy a directory (and all the files it contains), use scp with the -r option. This tells scp to recursively copy the source directory and its contents. You'll be prompted for your password on the source system ( deathstar.com ). The command won't work unless you enter the correct password.

Does SCP work with wildcards?

2) Unfortunatly, scp will not support wild cards as like rcp.

How do I copy multiple files from one server to another?

To copy files from a local system to a remote server or remote server to a local system, we can use the command 'scp' . 'scp' stands for 'secure copy' and it is a command used for copying files through the terminal. We can use 'scp' in Linux, Windows, and Mac.

Is SCP multithreaded?

SCP uses a single thread in SSH.


1 Answers

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\*
like image 188
Brian Agnew Avatar answered Oct 19 '22 20:10

Brian Agnew