Download data from ftp.

Dear all,
I am beginner to shell scripting.
I have to download more than 1k files from ftp site.
link is below
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/

Earlier i was using wget url, for download but the problem is some times folder names get changed, i don't know how to move in directories in the script (list of directories is not available). After entering in every directory i want to download files ending with ".fna" extension.

Please help me :confused:

I would suggest you see about using lftp, possibly within your shellscript.

It has an interesting feature named "mirror", specifically where you can recurse directories and download files matching a glob pattern, such as "*.fna"

LFTP - sophisticated file transfer program

HTH
dan

:confused:

There is an example here of downloading all .gif files using a cludge in wget. Might fit your requirement.

Wget Manual - Examples

Dear admax;
kindly post a written example for your requirement.

BR