≡ Menu

Linux / Unix: curl Command Download File Example

Why the hell would one use curl to do scp, when “scp” exists and is the direct tool?

copy from remote host to “here”
user@remote.host:/the/path/to/thefile . <– note the "."

copy from "here" to remote host:
scp file user@remote.host:/the/target/path/

pub key authentication is automatic if there is a key that is acceptable to the server in your .ssh directory.

  • Kikko July 30, 2012, 9:14 am

    …just for the sake of argument? :)

  • Will August 2, 2012, 1:44 am

    A developer can include libcurl and get the ability to scp, http get, etc in their application all in one shot. Or if you are building an embedded system you can get a wide range of capabilities out of one tool which can be very valuable.

  • sami September 20, 2013, 2:34 pm

    i have a problem downloading pdf files using curl command from http://www.ncbi.nlm.nih.gov for the document with an id such as PMC3516508, i used the following command:


    but i don’t get the pdf file for the document.

  • Ryan September 3, 2015, 3:45 pm

    I would like to know how to download a specific file type using wget or curl from a webpage.

  • Security: Are you a robot or human?

    Leave a Comment

    You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">