9

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.

2 Answers 2

11

This absolutely is possible

scp 192.168.1.2:/srv/myfiles/\{*.tar.gz,*.war\} .
2
  • This works, but it's asking for that password twice.
    – markus
    Nov 15, 2013 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, 2013 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  
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .