7

I want to transfer only files with special extensions (like only *.tar.gz, *.war) in one scp command (Debian Linux). Is this possible, if yes how is the syntax?

Should be someting like:

scp 192.168.1.2:/srv/myfiles/'*.tar.gz *.war' .

But this is not working.

11

This absolutely is possible

scp 192.168.1.2:/srv/myfiles/\{*.tar.gz,*.war\} .
  • This works, but it's asking for that password twice. – markus Nov 15 '13 at 10:43
  • Ah yes, I'm using keys, so I don't get prompted at all. Answer modified the above should only ask for the password once. – GeoSword Nov 15 '13 at 10:46
1
$ ssh 33 ls \{\*.log,\*.py\}
engine.log
install.log
parser_lex.py


$ scp 33:\{\*.log,\*.py\} /tmp/
engine.log                                                                                                                   100%   45     0.0KB/s   00:00    
install.log                                                                                                                  100%   18KB  18.0KB/s   00:00    
parser_lex.py                                                                                                                100% 2600     2.5KB/s   00:00  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.