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.

2 Answers 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

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>


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, 2017 at 15:03
  • Yes the command in the example provided will download 'document-excel-icon.png' to my desktop
    – Basil K Y
    Mar 17, 2017 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .