http get from the shell in Mac OS X

39,018

Solution 1

wget http://example.org/file.mp3

(you might need to install it e.g. using Homebrew, MacPorts or Fink -- assuming you're still on Mac OS X)

Alternatively, you can use curl, which is standard on Mac OS X:

curl http://example.org/file.mp3 > local_filename.mp3

Solution 2

Wget and curl may be not installed on some Unix-like system's by default. But you also can use:
fetch http://example.org/file.mp3
it save response to the current directory with URL filename. To change see man fetch

Share:
39,018

Related videos on Youtube

fakeit
Author by

fakeit

I like toast.

Updated on September 17, 2022

Comments

  • fakeit
    fakeit over 1 year

    I'd like to download a link like:

    http://example.org/file.mp3

    Now, I'm enough of a shell junkie to know what SCP does, but that's about where my geek-dom ends. So is there a shell program that lets me basically do an http get and pipe it through to a file?

    • Admin
      Admin over 13 years
      @fakeit If you respond to comments by other users, let them know by writing @PrefixOfUsername in your comment, e.g. @Daniel, @Dan, @fakeit or @fake. This way, they get notified by SuperUser. @Beck is close, but doesn't work.
    • Admin
      Admin over 13 years
      @Daniel Ah, thanks for the advice. So, won't everyone with "Daniel" in their prefix get notified too? Or is it smart and only looks for "Daniel's" that have answered / commented?
    • Admin
      Admin over 13 years
      At most a single person is ever notified through this @-functionality (so no notifying 20 people by filling your comment with @'s), plus always the person you authored the post on which you comment (that's why you're notified about this comment without an @ to you). It looks backward in time in the same comment thread and takes the most recent matching user. If a "Dan" were to comment here, he and I would be competing for any @Dan notifications by others, @Daniel would go to me though. The prefix must have 3 or more characters, @fa won't work.
    • Admin
      Admin over 13 years
      @Daniel Awesome. Thanks for all your help today. You rock.
    • Admin
      Admin almost 2 years
      These days simply use curl for this. Just type curl http://whatever that's it