Hello monks and Happy Easter to everyone!
I want to use Perl to download some files from an ftp site, namely
ftp://ftp.ncbi.nih.gov/genomes/Bacteria In particular, I want to be able to download all directories in this site (if you visit the link, you will see that there are numerous directories under the one I have written above), and, from each directory, I need only the files that have the extension
.faa in them.
For example, I need to have the directory
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Acidovorax_JS42
with 3 files in it, that is
NC_008765.faa ,
NC_008766.faa and
NC_008782.faa, because there are 3 files with the extension .faa in that directory.
I know nothing about Perl and the www, so I thought I ask here. What I only know to do is download the entire ftp site in my hd (using
wget -b tp://ftp.ncbi.nih.gov/genomes/Bacteria
and then start erasing the unecessary files (using
find . -name "*.xxx" |xargs rm where xxx is every file extension apart from .faa that I want to keep...
As you can understand, this is very time (and hard-disk) consuming, so I thought I ask for advice here.
Thank you in advance!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.