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'*.tar.gz *.war' .

But this is not working.


This absolutely is possible

scp\{*.tar.gz,*.war\} .
| improve this answer | |
  • 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
$ ssh 33 ls \{\*.log,\*.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  
| improve this answer | |

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.