Wget Equivalent in OS X

less than a minute of reading

The wget command is a very handy Linux tool. Unfortunately by default OS X does not offer it, but there is a decent workaround. Let me show you how to use cURL to achieve exactly the same effect.

The cURL tool is available in OS X (which curl). Let’s assume that we want to download the jQuery library into our project 's directory from the official mirror:

http://code.jquery.com/jquery-2.1.1.min.js

Simply open any terminal app of your choice and go to the destination location where you want to pull the file, like:

cd /Users/slick/Code/my-example-wordpress-website/wp-content/themes/my-example-theme/js/

Now type:

curl http://code.jquery.com/jquery-2.1.1.min.js -o jquery-2.1.1.min.js

What's the purpose of the -o?

This option gives you the ability to specify an output file.


Words: 138
Published in: macOS
Last Revision: December 28, 2022

Related Articles   📚