Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

do you know how I could transfer all files with a particular extension (ex. txt files) from a server and keep the folder sctructure using SSH Secure File Transfer?

I'm using Win 7 Pro 64-bit, and I do have some advanced knowledge in computing (if that's required).

EDIT: Just in case anyone sees this question, I couldn't find a way to do it (though I know there's some way to do it) with SSH, but I was able to achieve the same thing with FileZilla, using the Filter options.

share|improve this question
2  
What do you mean by file of the same type? –  heavyd Oct 2 '13 at 15:40
    
Thanks for editing the question, it seems file 'type' makes way more sense in portuguese than in english. –  Bruno Hebling Vieira Oct 2 '13 at 16:52

1 Answer 1

up vote 0 down vote accepted

SSH alone does not transfer files but it allows transferring a stream of data and running commands on the remote computer.

This means that you can use any utility which will transform your files into a stream of data pass the stream through SSH and on the other end do the reverse process - extract the files from the stream. Below is an example with tar.

find /source/path -iname "*.ext" -print0 |
  tar --null -cf- -T- |
  ssh user@machine "tar -xf- -C /path/to/extract"

The command sequence can be on single line I added newlines for better readability. Probably only GNU tar has the --null and -T options.

If you do not have the suitable tools on your Windows you can install for example Cygwin.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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