I'm trying to download multiple files and need to rename as I download, how can I do that and specify the directory I want them to download to? I know i need to be using -P and -O to do this but it does not seem to be working for me. I'm writing this into a php script and running on unix.
You have to either specify the
-P or the
-O, for example:
wget --directory-prefix="/home/admin/" http://someurl
wget --output-document="/home/my_new_file_name" http://someurl
In the first example it will download anything you want to the specified directory and at the 2nd example it will download the file with the new given name to the given directory.