How do I use wget
to download files to a specific location, without creating directories, and overwrite the original every time.
I've tried using the -r
-P
and nc
options in combination but this resulted in several undesirable effects.
wget -P ./temp -r "https://raw.githubusercontent.com/octocat/Spoon-Knife/master/README.md" -nd
The above downloads README.md
to the /temp
directory in the current folder, but preserves the original README.md
and numbers all subsequent README.md
files.
wget -r -P ./temp "https://raw.githubusercontent.com/octocat/Spoon-Knife/master/README.md" -nd
Above command does the same thing.
wget -P ./temp -nc "https://raw.githubusercontent.com/octocat/Spoon-Knife/master/README.md" -r
With this one, the file is replaced but directories are created.