Google Drive, How to tutorials, Linux, Linux.Tips

How to direct download Google Drive files in Linux terminal?

1 min read

Recently I have been working with Google Cloud Platform and using the virtual machines to work on a data science project. I came across a dataset that I need to download from Google Drive into my virtual machine. Google does not provide you with a direct download link. I came across this clever command which allowed me to download the file from my terminal and I want to share with you all.

We will need the google drive shareable link. Example of what a google drive shareable link:
https://drive.google.com/file/d/13oki4nUEp3z_6Sl4NovhldB90HZ1w1c-/view?usp=sharing

Identify the FILEID in the link above. FILEID = 13oki4nUEp3z_6Sl4NovhldB90HZ1w1c-Identify the FILENAME in the link above. FILENAME = Linemod_and_Occlusion.zip

Install gdown package using the following command:

pip install gdown

Once the gdown package is installed use the following command to download a file from Google Drive:

gdown --id FILEID

For example the following command successfully runs:

gdown --id 13oki4nUEp3z_6Sl4NovhldB90HZ1w1c-


Leave a Reply