15

I want to fetch a tarball of this python library from terminal. https://github.com/simplegeo/python-oauth2/downloads

However, I cannot simply call

wget https://github.com/simplegeo/python-oauth2/tarball/master

because doing so retrieves a web page. How do I fetch this resource from terminal?

1
  • web browser from terminal, such as lynx? Jul 18, 2012 at 3:49

1 Answer 1

20

Use curl instead – and if you know it's a tar archive, you can just pipe the output into tar to extract it automatically.

curl -L https://github.com/simplegeo/python-oauth2/tarball/master | tar xz

If you just want to save the file, use the -o option with your own name, or try -O, which will use the remote file name automatically (but might not always work).

From man curl:

-L: If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .