14

I use the combination of Flashgot and wget for downloads. I reset my Firefox preferences due to some other problems. Then I reconfigured everything (including add-ons, cache, etc).

After that, when I tried to download something, it automatically saved into the "Videos" folder. But before resetting the settings, I could download items to "Downloads".

What should I do to make the default directory of wget to "Downloads"?

2 Answers 2

29

wget by default will store downloads to the current directory where you run the wget command.


Method 1: Pass the -P option to specify a download directory

  • To change the directory, you need to add the -P argument in your wget command:

    wget -P /path/to/directory <download-url>
    

    Or

    wget --directory-prefix=prefix <download-url>
    

    where prefix is the directory where you want the downloads to be stored.

    With this method, you need to specify the -P or --directory-prefix=prefix every time you download.

Method 2: Use alias to make a permanent default directory

  • To set a permanent default download directory, you can use alias, like this:

    alias wget='wget --directory-prefix=prefix'
    

    Change prefix with the directory you want and put the alias command on .bashrc to make it permanent.

2
  • when i clicks on the flashgot icon, there is no need of executing commands manually. It shows commands automatically in an X-Terminal. There is no space to type a comand. It does everything automatically. And i need to change the default folder.
    – 001neeraj
    Nov 6, 2012 at 8:56
  • I see. Try the second method, since Flashgot will use the system's wget settings.
    – Peachy
    Nov 6, 2012 at 9:07
15

As far as I was aware wget usually downloads into the current working directory. You have the following options to specify the directory.

1.Change to the directory you wish it to be downloaded to first then run your wget command.

cd /home/yourname/Downloads

Then run your wget command

wget http://download.files.com/software/files.tar.gz

2.Add the directory to the wget command like this.

wget -P /home/yourname/Downloads http://download.files.com/software/files.tar.gz  
4
  • when i clicks on the flashgot icon, there is no need of executing commands manually. It shows commands automatically in an X-Terminal. There is no space to type a comand. It does everything automatically. And i need to change the default folder.
    – 001neeraj
    Nov 6, 2012 at 8:41
  • 1
    Your question asks about the "wget default directory" and you go on to say "I use the combination of Flashgot and wget for downloads". You might want to clarify that you are looking for the default download directory of Flashgot. This should help forums.informaction.com/viewtopic.php?f=6&t=4811
    – CoalaWeb
    Nov 6, 2012 at 9:14
  • 7
    the last command gave me /home/ohad/Downloads: Is a directory error. -O tells wget to download into a file.
    – Ohad Cohen
    Jan 16, 2015 at 19:26
  • The flag should be -P /target_dir
    – THN
    Mar 12, 2020 at 5:22

You must log in to answer this question.

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