User Tools

Site Tools


ubuntu:wget:download_and_store_with_a_different_file_name

Ubuntu - wget - Download and Store With a Different File name

By default wget will pick the filename from the last word after last forward slash, which may not be appropriate always.

Wrong: Following example will download and store the file with name: download_script.php?src_id=7701

wget http://www.vim.org/scripts/download_script.php?src_id=7701

Even though the downloaded file is in zip format, it will get stored in the file as shown below.

ls

Displays:

download_script.php?src_id=7701

Correct: To correct this issue, we can specify the output file name using the -O option as:

wget -O taglist.zip http://www.vim.org/scripts/download_script.php?src_id=7701
ubuntu/wget/download_and_store_with_a_different_file_name.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki