PDA

View Full Version : UNIX question regarding wget




Let's Sekuhara!
Jun 5, 2012, 11:35 PM
Hi, how can I use wget to download all of the contents of a folder on a web server to my Mac?

I've found this bit of code for doing this, but it's not clear where on my machine the files will be saved to if I run the script.

wget -r -A jpeg,jpg,bmp,gif,png http://www.domain.com



joemod
Jun 6, 2012, 12:39 AM
Hi, how can I use wget to download all of the contents of a folder on a web server to my Mac?

I've found this bit of code for doing this, but it's not clear where on my machine the files will be saved to if I run the script.

wget -r -A jpeg,jpg,bmp,gif,png http://www.domain.com

Although not in a Mac at the moment, it will save them at the current directory, where you type the command from. If you type it right after opening console, that directory will be your home (/~). To be sure type pwd (print working directory) before wget.

wrldwzrd89
Jun 6, 2012, 12:48 PM
It's also worth noting that OS X does NOT come with wget. You'll need to install Xcode, download the Command-Line Tools if need be from within Xcode (this only needs to be done for Xcode 4.3 and later), then download/compile wget.

wget is really easy to build yourself, once the prerequisites are satisfied.
A simple:
cd /path/to/wget-VERSION
./configure
make
sudo make install
... will do the trick. Note that it installs to /usr/local/bin by default, a location that is NOT in the default PATH.

robvas
Jun 7, 2012, 07:21 AM
It's also worth noting that OS X does NOT come with wget. You'll need to install Xcode, download the Command-Line Tools if need be from within Xcode (this only needs to be done for Xcode 4.3 and later), then download/compile wget.

wget is really easy to build yourself, once the prerequisites are satisfied.
A simple:
cd /path/to/wget-VERSION
./configure
make
sudo make install
... will do the trick. Note that it installs to /usr/local/bin by default, a location that is NOT in the default PATH.

Or install Homebrew - http://mxcl.github.com/homebrew/

And then just type 'brew install wget'

wrldwzrd89
Jun 7, 2012, 08:06 AM
Or install Homebrew - http://mxcl.github.com/homebrew/

And then just type 'brew install wget'
I think MacPorts may have a wget available too - I've never used it before, though, so I don't know how it works.

subsonix
Jun 7, 2012, 08:34 AM
I think MacPorts may have a wget available too - I've never used it before, though, so I don't know how it works.

They sure do. 'port install wget'