Download from Google Drive using wget in Linux

By default, Google Drive does not allow plain wget commands (e.g. wget google-drive-link) in Linux. The workaround is to use the following syntax:

For example, to download the example.zip file from the Google Drive link below:
https://drive.google.com/open?id=1vzHBVXvpF0dFKaDamJ6THg-0Gc-cSDoR

You can use the following wget command in Linux. Note that you have to enter the google drive file id twice and also enter the file name.
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1vzHBVXvpF0dFKaDamJ6THg-0Gc-cSDoR' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1vzHBVXvpF0dFKaDamJ6THg-0Gc-cSDoR" -O example.zip && rm -rf /tmp/cookies.txt

Thanks to this website below for the idea:
https:// pc-mind.com/how-to-download-google-drive-files-with-wget-linux-tiny-and-big-file-size/

PHP Redirection Script

<?php
    header("Location: http://new_url/");
?>

I always forget the syntax and always have to google for it. So I am putting this code here. Am so lazy, you see. :o)