Ubuntu / Linux news and application reviews.

Update: grive was abandoned and no longer works. You may want to take a look at Grive2 instead.

grive google drive linux client

The Google Drive client isn't yet available for Linux and the old Google Docs FS doesn't work too well with Google Drive, so besides the web interface, the best solution to get Google Drive on Linux right now is using Grive, an unofficial, open source, command line Linux client for Google Drive.

For now, the application is considered experimental and it lacks full sync, but it can upload and download new or changed files already (so you can access your files offline). What it can't do yet is: wait for changes and automatically sync the files or delete files (when a file is deleted locally, it's ignored and when it's deleted remotely, it's reuploaded if it exists locally).

Initially, Grive didn't support uploading new files and it could only upload changed files but the latest version from GIT (available in the WebUpd8 PPA) supports uploading new files too. However, in my test, this only works for one file at a time. Hopefully, this will be fixed soon.

Update: the issues above have been fixed (except for watching for changes and automatically syncing them) in the latest Grive.


Install Grive (CLI Google Drive Client) in Ubuntu


To make it easy to install, I've uploaded the latest Grive to the main WebUpd8 Ubuntu PPA, so to install it, use the commands below:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install grive


Using Grive


grive authenticate

1. Grive will download / upload new or changed files from the directory you run it so firstly, create a new folder, let's call it "grive", in your home directory:
mkdir -p ~/grive

2. Next, navigate using the terminal into the newly created "grive" folder:
cd ~/grive

3. The first time you run Grive, you must use the "-a" argument to grant it permission to access your Google Drive:
grive -a

After running the command above, an URL should be displayed in the terminal - copy this URL and paste it in a web browser. In the newly loaded page, you'll be asked to give Grive permission to access your Google Drive and after clicking "Allow access", an authentication code will be displayed - copy this code and paste it in the terminal where you ran Grive.

That's it. Now each time you want to sync Google Drive with your local "grive" folder, navigate to the "grive" folder (step 2) and run "grive" (this time without "-a" since you've already authenticated Grive with Google Drive).

Arch Linux users can install Grive via AUR.

For other Linux distributions, download Grive binaries from HERE (note: the binaries are pretty old at the time I'm writing this and some features might be missing, like uploading new files) or get the source.

Report any issues you may find @ GitHub.

Update: grive was abandoned and no longer works. You may want to take a look at Grive2 instead.


Thanks to Micah Nordland for the tip!