at. at. -5 years ago 223
Linux Question

How to download a file into a directory using curl or wget?

I know I can use the following 2 commands to download a file:

curl -O

But I want them to go into a specific directory. So I can do the following:

curl -o mydir/
wget -O mydir/

Is there a way to not have to specify the filename? Something like this:

curl -dir mydir

Answer Source

The following line will download all the files to a directory mentioned by you.

wget -P /home/test

Here the files will be downloaded to /home/test directory

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download