# Where did wget command go?



## simple (Jun 13, 2005)

Hi all, this is my first mac. I've never used OSX or freeBSD, which is what I'm told its based on. I have used linux and there was a command called wget, which I cannot find on my mac. I thought it would be here since this is still unix. I'm trying to run a shell script called bashpodder and it calls for the wget command, but all I get is an error stating that there is no such command. Do I have to installed the developer package to get this or something?


Thanks all


----------



## chornbe (Jun 13, 2005)

You can install it from a host of sites, or simply use the CURL command



```
curl [url]http://www.yahoo.com[/url] > yahoo_com.html
curl [url]ftp://user:pwd@site.com/dir/dir/file.txt[/url] > ~/file.txt
```

Curl is slightly different in that it sends downloaded data to stdout by default, but you can redirect it (as above) or check its various and plentiful command line switches for local file creation, piping, etc. It's a very sweet utility.


----------



## spb (Jun 17, 2005)

If you're familiar with the linux tool apt-get you can also use this to install software.

sudo apt-get install wget

Also make certain that your path includes the /sw/bin/ directory, which is where wget and all of the useful software is stored after being installed.


----------



## chornbe (Jun 17, 2005)

isn't that installed with Fink and, thus, not part of the base Apple OS/X installation?


----------



## spb (Jun 17, 2005)

chornbe said:
			
		

> isn't that installed with Fink and, thus, not part of the base Apple OS/X installation?



Yes, you're right, I think.  

I guess I'm assuming that simple is a UNIX/Linux user so he's already installed fink and the XCode tools.  If he doesn't have this installed we'd get a comment back about, "I can't find apt-get"  :7)


----------



## chornbe (Jun 17, 2005)

Ah, gotcha


----------



## scruffy (Jun 17, 2005)

curl with the -O flag (capital o, not zero) flag will save the file to disk rather than sending it to stdout.


----------



## elander (Jun 18, 2005)

Actually, "curl" is like "wget" on steroids. You can do just about anything with curl that you can do with wget, and then some. Have a look at this comparison:

http://tinyurl.com/dzz7c


----------



## scruffy (Jun 18, 2005)

The one thing, for my purposes, that curl lacks, is the ability to parse html itself.  wget can download an html page, parse it for links, and recurse down those links - allowing you to spider a whole website looking for broken links, or download a complete web page with all necessary stylesheets, images, external scripts, frame contents, etc.  It will even rewrite the links in the documents in the downloaded documents to point to the on-disk copies.


----------

