biztiger biztiger - 5 months ago 13x
Bash Question

Rename file by removing url parameter in linux

I downloaded some files using and the files are in the following format:

Is there any way, to rename those files properly by removing the URL parameters. Also is there any way, to download such files, with proper name(without URL parameter) from

I tried with
with the following command:

mmv "*.zip*" ""

But I can't find any way to install
. I am using CentOS 6. So, please suggest any way, other than this.

for file in *.zip\?*; do mv "$file" "${file%%\?*}"; done

As far as I can tell, there's no option to wget telling it not to include the query string in the local filename. You can use the -O option to specify an explicit filename, and fix the driver script to remove the query string itself.