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
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>
eg:
wget -P /home/basil/Desktop http://icons.iconarchive.com/icons/treetog/junior/256/document-excel-icon.png
-
-
Yes the command in the example provided will download 'document-excel-icon.png' to my desktop Mar 17, 2017 at 15:15