Download Files From Google Drive using Ubuntu Command Line

Getting Google Drive File ID:

https://drive.google.com/file/d/1LDbcRFGiZrzIMCfnLZ6Xyeym1Kv3TdmD/view

Use the Below Command and Replace the FileID with 1LDbcRFGiZrzIMCfnLZ6Xyeym1Kv3TdmD from the Above google drive link:

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=FILEID' -O- | sed -rn ‘s/.*confirm=([0–9A-Za-z_]+).*/\1\n/p’)&id=FILEID” -O FILENAME && rm -rf /tmp/cookies.txt

Resulting Command is below:

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=1LDbcRFGiZrzIMCfnLZ6Xyeym1Kv3TdmD' -O- | sed -rn ‘s/.*confirm=([0–9A-Za-z_]+).*/\1\n/p’)&id=1LDbcRFGiZrzIMCfnLZ6Xyeym1Kv3TdmD” -O xsum.zip && rm -rf /tmp/cookies.txt

References:

https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99

--

--

Kaustav Mukherjee

DISTRBUTED DEEP LEARNING ARCHITECT,DATA PHILOSOPHER,MACHINE LEARNING ON REAL-TIME STREAMS