gdrive: A Simple Google Drive CLI Client (Cross-Platform)

gdrive (not to be confused with Grive!) is a simple command line Google Drive client written in Go, available for Linux, Windows, FreeBSD and Mac OS X.

The tool was created for uploading and downloading files from/to Google Drive and it doesn’t support any kind of synchronization. In fact, gdrive can’t even download multiple files at once.

However, gdrive is still useful for one-off uploads / downloads (for automated uploads of a backup archive for example), especially since Grive, another command line Google Drive client (which does support sync) that’s quite popular among Linux users, wasn’t updated since May, 2013 and looks pretty much dead.

Using gdrive

To use gdrive, you must firstly authenticate it with Google. Do this, simply run «drive» in a terminal (this assumes that you’ve installed the gdrive binary as «drive», by following our installation instructions — see below):

<code>drive</code>

A link should be displayed in the terminal, which you need to copy and paste in your web browser. In your web browser, click «Accept» and copy the resulting code and paste it in the terminal where you ran «drive».

To be able to download files from Google Drive to your computer, you must use the file id. To find out this id, run the following command to get a list of recent files (and their ids) available in your Google Drive:

Important: gdrive can’t upload multiple files unless you place them in a folder and pass the folder path to gdrive — for instance, you can use wildcards to upload multiple files in the current directory at once (so for example, «drive upload —file *.txt» won’t work).

Download gdrive

Download gdrive (binaries available for Linux — 32bit, 64bit, Arm and Raspberry Pi -, Windows, Mac and FreeBSD as well as the source code)

To report bugs, help with its development, etc. see the gdrive GitHub page.

Install gdrive in Linux

The gdrive GitHub page offers binaries for Linux (well as Windows, etc.) for 32bit, 64bit, Arm and a binary especially for Raspberry Pi. To install it, download the binary, place it in your home folder and run the following command to install it to /usr/local/bin/ as «drive»: