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 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?

share|improve this question
    
web browser from terminal, such as lynx? –  Jakob Weisblat Jul 18 '12 at 3:49

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer

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.