It seems that curl doesn't have the ability to do that, and wget can do the job. (doing this on Mac OS X)


wget -r --no-parent http://localhost:8080

will download to a folder called localhost:8080


wget -r --no-parent http://localhost:8080 -P sample

will download to a folder called sample/localhost:8080

is there a way just to download to sample (without the localhost:8080 part?)

P.S. I am downloading localhost:8080 because node.js can serve my page that was written in React JS, but the "compiled file" bundle.js is no way to be found in my whole directory, so I just use wget to do the job and it also can download index.html and those files in style/ or css/ also.

wget -r http://localhost:8080 -P sample -nH

, where -nH (or --no-host-directories) will not create the host directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.