LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using ftp client (https://www.linuxquestions.org/questions/linux-newbie-8/using-ftp-client-309689/)

Martin Strand 04-04-2005 03:18 PM

Using ftp client
 
Hi, I just installed Debian's "ftp" package and want to use it to download all files from another server of mine. I can log in and download individual files, but I don't know how I would tell the client to download _everything_ rather than one file at a time. It's over 5000 files, I'd hate to do it by hand, lol.

Thanks,
Martin

naimslim89 04-04-2005 03:41 PM

I don't regularly use FTP, but you may try to use wildcards when obtaining the files.

Code:

$ ftp site.domain.com (your site here)
la-de-da... (login information)
Password:
...

> get *

Here's how wildcards work:

* means any character, any number of characters. Anything, basically.
For example:

* = any file - can be used to download ALL files.
*.html = any file with the HTML extension
cat* = any file that begins with "cat" and has any character(s) after it.

? means ONE character, whatever it may be.

For example:

??? = any three-character-long file.
lib??????.so = any file that begins with "lib", followed by six characters of any kind, and ends in ".so"

These are the two that I can think of off the top of my head but I'm sure they're others!

Let us know how you get on!

Tinkster 04-04-2005 04:00 PM

get doesn't accept wild-cards.

To be able to use a wildcard you'll need to use
mget *
To NOT be asked for each file you want to turn
prompting off (it's on by default).
So, a sensible thing (once you're logged in) would be:
bin
prom
mget *




Cheers,
Tink

Martin Strand 04-04-2005 04:13 PM

Seems like mget * won't work. Instead, I had to use mget subdir/*. Well, it's still a lot better than grabbing all of them by hand. :)

Thanks for your input. I'll be back with more stupid questions soon. ;)

Tinkster 04-04-2005 04:15 PM

Quote:

Originally posted by Martin Strand
Seems like mget * won't work. Instead, I had to use mget subdir/*. Well, it's still a lot better than grabbing all of them by hand. :)

Thanks for your input. I'll be back with more stupid questions soon. ;)

Well, yeah ... the standard ftp tools know nothing
about recursion. The mget * would have worked
if you had done a "cd subdir" first.



Cheers,
Tink

Martin Strand 04-04-2005 04:19 PM

Ok, I see now. Thanks.

naimslim89 04-04-2005 05:33 PM

Quote:

Originally posted by Tinkster
get doesn't accept wild-cards.
Oops, my bad! :newbie: only made an assumption because of the ability to use them in the shell.


All times are GMT -5. The time now is 04:27 PM.