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.

I am having a bit of problem using cURL to download using FTP, that is to say I think it's being rather slow if working at all. I usually use wget an this one file which I downloaded earlier with wget started and finished under 10 minutes. The size was about 200 MB, a Linux distribution. I tried it later on with cURL, first time using it, and all I did was type in the FTP address after the cURL command as I would with wget. I started seeing the source code and everything, but it's been like an hour and it still hasn't finished, is this normal? My connection seems fine, as fast as it's supposed to be. I would appreciate if someone who uses cURL or knows about it extensively could explain the matter.

-

Currently using: Ubuntu 9.10/Windows 7, Crunchbang 9.04/Windows XP.

share|improve this question
    
What's the exact command you used, what switches if any? –  Marcin Jan 13 '10 at 3:41
    
i did the same thing my first time using curl; it's just a different tool with different defaults, that's all. –  quack quixote Jan 13 '10 at 3:49

2 Answers 2

up vote 1 down vote accepted

wget saves to a file by default; cURL by default outputs to STDOUT (meaning your screen). You need to specify that it should be outputting to a file. You can do this with the -o (aka --output) switch, or with shell redirection:

# switch to the curl command
curl ftp://someserver.com/path/to/file -o output.filename.here

# shell redirection
curl ftp://someserver.com/path/to/file > output.filename.here

The slowness probably is due more to the output going to the terminal screen than your network speed; once you redirect the output to a file you should see download speeds roughly equivalent to what you got with wget.

share|improve this answer
1  
This sounds like the case. I'm sure we've all made this mistake at some point or another and had the terminal bark at us, +1 :) –  John T Jan 13 '10 at 3:55
    
That's why in my comment I asked him what switches he used when he ran it ;) –  Marcin Jan 13 '10 at 4:19
    
@marcin: if you read closely, he already said he didn't use any switches: "all I did was type in the FTP address after the cURL command as I would with wget" –  quack quixote Jan 13 '10 at 4:22
    
Thanks, it was a stupid mistake on my part thinking it must work the same way as wget, should have read the manuals first. –  Ibn Ar-Rashid Jan 13 '10 at 4:34
    
I guess he did, I must have missed it. –  Marcin Jan 13 '10 at 4:53

The reason you're seeing source code is probably because you haven't specified an output file as ~quack has mentioned.

I've never had speed issues with cURL via FTP, you may have also picked a bad server in terms of distance and speeds. Sometimes a site will provide a single download link that will actually dynamically pick you a mirror when you access it. You may have gotten a different, slower server the second time around.

share|improve this answer
    
bad server is possible, but i think it's more likely due to outputting to the terminal. remember terminal output speeds are on the order of analog POTS modems -- 9600 baud, 14400, etc. your TTY's baud rate is probably specified in /etc/inittab (if it's a real TTY; not sure where pseudo-TTYs are defined). –  quack quixote Jan 13 '10 at 3:54
    
Yeah that likely is the problem, it seems we were both commenting each other's answers at the same time! Just some alternate possibilities that may add to it. –  John T Jan 13 '10 at 3:56
    
np. you're not wrong, i just took advantage of your answer to point out the actual term speeds. :) –  quack quixote Jan 13 '10 at 4:05

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.