0

When I download anything by means of wget, how can I set the download directory? I mean just like while normally downloading something from web there's a prompt asking where to save. Is it possible to set the directory while downloading with wget? Thanks in advance.

0

You can use -P option to download contents to a diiferent directory(no need to use cd).syntax:

wget -P <directory where you want to save> <url of the file>

eg:

wget -P /home/basil/Desktop http://icons.iconarchive.com/icons/treetog/junior/256/document-excel-icon.png
  • So is it wget -P /directory #link , like that? – sphoenix Mar 17 '17 at 15:03
  • Yes the command in the example provided will download 'document-excel-icon.png' to my desktop – Basil K Y Mar 17 '17 at 15:15
2

When you open the terminal, by default, you are in your home directory. If you wish to download with wget into some other directory, simply change directories to the desired location; for example:

cd ~/Downloads
wget http://blah/some_file

Or, another example:

cd ~/Desktop
wget http://blah/some_file

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.