0% found this document useful (0 votes)
592 views

How To Upload File To Google Drive From Linux Command Line

The document describes the steps to upload files to Google Drive from the Linux command line using the gdrive tool. It explains that gdrive is downloaded from GitHub and then used to authenticate with Google Drive via a browser, and then upload files with commands like gdrive upload. Authentication generates a token that is copied and used by subsequent gdrive commands to manage files in the Google Drive account.

Uploaded by

rwsilva32
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
592 views

How To Upload File To Google Drive From Linux Command Line

The document describes the steps to upload files to Google Drive from the Linux command line using the gdrive tool. It explains that gdrive is downloaded from GitHub and then used to authenticate with Google Drive via a browser, and then upload files with commands like gdrive upload. Authentication generates a token that is copied and used by subsequent gdrive commands to manage files in the Google Drive account.

Uploaded by

rwsilva32
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

09/09/2022 11:53 How to Upload File to Google Drive from Linux Command Line | by Utkarsha Bakshi | Geek Culture

Bakshi | Geek Culture | Medium

Open in app Get started


Sign in to Medium with Google

Published in Geek Culture


Regis Silva
[email protected]

You have 2 free member-only stories left this month.


Continue as Regis
Sign up for Medium and get an extra one
To create your account, Google will share your name,
email address, and profile picture with Medium. See
Medium's privacy policy and terms of service.
Utkarsha Bakshi Follow

Dec 26, 2021 · 2 min read · · Listen

Save

How to Upload File to Google Drive from Linux


Command Line

Source (link)

Using a command line tool could be useful while uploading large files to Google
Drive. In this short post, I will walk you through the steps of using gdrive Linux
command line utility to upload files to Google Drive.

We will be using an third party open source tool called gdrive.

https://medium.com/geekculture/how-to-upload-file-to-google-drive-from-linux-command-line-69668fbe4937 1/5
09/09/2022 11:53 How to Upload File to Google Drive from Linux Command Line | by Utkarsha Bakshi | Geek Culture | Medium

GitHub - prasmussen/gdrive: Google Drive CLI Client Open in app Get started
Sign in to Medium with Google
gdrive is a command line utility for interacting with Google Drive.
gdrive is finally verified for using sensitive…
github.com Regis Silva
[email protected]

Continue as Regis

Lets get right into it. To create your account, Google will share your name,
email address, and profile picture with Medium. See
Medium's privacy policy and terms of service.
Step 1: Download the latest release from Github
First, download the latest release tar from Github.

wget
https://github.com/prasmussen/gdrive/releases/download/2.1.1/gdrive_
2.1.1_linux_386.tar.gz

Step 2: Unzip the Archive


Next, unzip the archive using the tar command.

tar -xvf gdrive_2.1.1_linux_386.tar.gz

Step 3: Perform Authentication


Next, execute the following command to get the authentication URL.

./gdrive about

In the console you will see an authentication URL that you can click and open in the
browser to obtain an auth token.

When the URL opens in the browser, just select your account and copy the auth
token that is displayed on the next screen.

https://medium.com/geekculture/how-to-upload-file-to-google-drive-from-linux-command-line-69668fbe4937 2/5
09/09/2022 11:53 How to Upload File to Google Drive from Linux Command Line | by Utkarsha Bakshi | Geek Culture | Medium

Open in app Get started


Sign in to Medium with Google

Regis Silva
147 7
[email protected]

Continue as Regis

To create your account, Google will share your name,


email address, and profile picture with Medium. See
Medium's privacy policy and terms of service.

Step 4: Upload the File to Google Drive


Now that you are authenticated, you can go ahead and upload the file.

./gdrive upload /home/documents/file_name.zip

The command will upload the file to Google Drive. You can use the list command to
list the files in your drive.

./gdrive list

For a comprehensive list of commands refer to the official documentation.

GitHub - prasmussen/gdrive: Google Drive CLI Client


gdrive is a command line utility for interacting with Google Drive.
gdrive is finally verified for using sensitive…
github.com

https://medium.com/geekculture/how-to-upload-file-to-google-drive-from-linux-command-line-69668fbe4937 3/5
09/09/2022 11:53 How to Upload File to Google Drive from Linux Command Line | by Utkarsha Bakshi | Geek Culture | Medium

Open in app Get started


That’s it for this post. Please leave a clap if you
Signfound the post
in to Medium withtoGoogle
be helpful. Consider
taking a Medium membership to continue reading all my premium articles along
with 1000s of other stories. Regis Silva
[email protected]

Continue as Regis
Join Medium with my referral link - Utkarsha Bakshi
To create your account, Google will share your name,
Read every story from Utkarsha Bakshi (and thousands of other
email address, and profile picture with Medium. See
writers on Medium). Your membership fee directly supports…
Medium's privacy policy and terms of service.
utkarshabakshi.medium.com

Enjoy the read? Reward the writer.Beta


Your tip will go to Utkarsha Bakshi through a third-party platform of their choice, letting them know you appreciate
their story.

Give a tip

Sign up for Geek Culture Hits


By Geek Culture

Subscribe to receive top 10 most read stories of Geek Culture — delivered straight into your inbox, once a week. Take
a look.

Your email

Get this newsletter

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our
privacy practices.

https://medium.com/geekculture/how-to-upload-file-to-google-drive-from-linux-command-line-69668fbe4937 4/5
09/09/2022 11:53 How to Upload File to Google Drive from Linux Command Line | by Utkarsha Bakshi | Geek Culture | Medium

Open in app Get started


Sign in to Medium with Google

About Help Terms Privacy


Regis Silva
[email protected]

Get the Medium app Continue as Regis

To create your account, Google will share your name,


email address, and profile picture with Medium. See
Medium's privacy policy and terms of service.

https://medium.com/geekculture/how-to-upload-file-to-google-drive-from-linux-command-line-69668fbe4937 5/5

You might also like