Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
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. – Firebug Oct 2 '13 at 16:52
@BrunoHeblingVieira 'file type' is ok. Maybe that commenter questioned what you meant because in your title you had written "from a given type" whereas 'of' would be the right term rather than from, Also though, file extension is technically better, if that's what you are specifying, and it is possible that a file's type isn't determined by its extension. The find command(the *nix one you can use via cygwin) might be able tp be amended to specify file type rather than extension i.e. regardless of extension. That would probably suit your purposes too – barlop May 16 '15 at 12:23
up vote 1 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

Just in case anyone sees this question, I was able to achieve the same thing with FileZilla, using the Filter options.

share|improve this answer

Your Answer


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.