How to Use Google Drive on Ubuntu Linux via Command Line

Google Drive is modern, convenient and quite useful Google software that works directly in real time and gives you chance to use it online at any time and from any place or device you want. The program specializes in file storage and synchronization services provided by Google and offering great pack of additional extras like sharing, cloud storage and editing in collaboration. Google Drive provides you also Google Docs, Sheets and Slides.
Mainly, the customers, who use Google Drive are owners of the following types of devices and gadgets: PC, which are powered by the operative systems Windows XP, Windows Vista, Windows 7 and 8, Max OS X 10.6 or a newer version, as well as the mobile devices, which have become quite more preferable these days for work and entertainment by the audience, in general – Android smartphones, tablets, iPhones and iPads. Linux clients, as a matter of fact, are able and allowed to use the Google Drive, too. Up to the last few years Google has not provided particular client software for the Linux OS, but you could, though, add the Google Drive system easily to the Linux Os file system. However, recently the leading IT giant – Google – has developed its Google Drive software for Linux, too. It is out now and you can simply work with this sharing and storing files system, if you are a Linux client and if you follow all of our guides. Check out now how to use Google Drive on Linux step by step with our helpful and easy guide.

Back in the days, when Google released its Drive sharing plus storing program in the end of April, 2012 year, the company mentioned that soon the a Linux support and version will be out. Though, we waited for them too late! Thankfully, the waiting worth it and now we can finally check out the official Google Drive Linux alternative, because up to now Linux clients still had options to use Google Drive.

Say Hello to the Drive

The drive is actually a tiny program with a command line and with a main purpose to support Linux and Max OS X. The program is also an open-source type of software, which is written in the familiar Go programming language by Google. To be more specific the actual creator of drive is Burcu Dogan, who used to be a part of the official Google Drive team. Moreover – the participation of Dohgan in the Google Drive introduction to Linux clients is official and entirely copyrighted by the company.

Even though the huge disappointing from the 2-year waiting, drive is now a fact, but it does not appear in the background and sync files back and forth. On the contrary – drive is actually a command that you need to run directly from your Linux-based device in all cases, when you want to put a particular file directly to your personal Google Drive account. It is here where we need to say that if you used to have a valid Google Drive account for any other OS or device, you can use the same one for Linux, too. The same philosophy works, when you want the perform the opposite action – to pull a file from your Google Drive storage and move it to your individual Linux device. Both commands are quite adventurous for customers, who are in need to preserve and entire virtual machine among the storage files in your Google Drive box. The immediate synchronization of a file, short text, image or anything you can think about will not take too many actions and will not require from you to synch the entire giant virtual machine.

Install Google Drive on Ubuntu

The drive app requires you to install a Google`s Go language compiler of a 1.2 version. If you use Ubuntu 14.04, the installation – including with all the additional drive tools and extensions – are possible with this command.

sudo apt-get install golang git mercurial

When the installation is completed, proceed with the next command in order to do the downloading and the installation of the drive program, before that make sure you have set GOPATH and other go variables better in ~/.bashrc.

export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin
go get -u

And now it is time to run this command to simplify your next drive-based steps! Make sure, you have finished with the initialization of the drive by using this command. Note that you have to specify your choice of a local directory, as well as about the current Google account authentication you have.

drive init ~/gdrive
Visit this URL to get an authorization code
Paste the authorization code: <paste your code here>

Ubuntu Linux Init Google Drive Command

Now when you are authenticated you can push and pull files from you Google Drive. For that purpose go to gdrive and execute the following command.

cd ~/gdrive
drive pull

And now you can go on with the drive push, which command will help you to move along the file to the different servers. With a drive push test.txt command you can quickly move the test.txt file from your Linux-based device to Google Drive storage directly. The same matters for the pulling out – from a Linux device to the Google Drive storage box.

howopensource@esprimo:~/gdrive$ drive push test.txt
+ /test.txt
Addition count 1 src: 25.00B
Proceed with the changes? [Y/n]: 
1 / 1 [============================================================================] 100.00 % 1s

Google Drive Push Command Ubuntu Linux

To get a help just run drive without parameters.

howopensource@esprimo:~/gdrive$ drive
Usage: drive 

where  is one of:
  emptytrash      permanently cleans out your trash
  pub             publishes a file and prints its publicly available url
  touch           updates a remote file's modification time to that currently on the server
  untrash         restores files from trash to their original locations
  list            lists the contents of remote path
  push            push local changes to Google Drive
  trash           moves files to trash
  unpub           revokes public access to a file
  about           print out information about your Google drive
  diff            compares local files with their remote equivalent
  features        returns information about the features of your drive
  help            Get help for a topic
  pull            pulls remote changes from Google Drive
  init            initializes a directory and authenticates user
  quota           prints out information related to your quota space
  version         0.0.5

drive  -h for subcommand help

Google Drive Ubuntu Help Page Linux

Here is one more command to see how much free space do you have:

howopensource@esprimo:~/gdrive$ drive quota
Name: HowOpenSource
Account type:	LIMITED
Bytes Used:	1501712              (1.43MB)
Bytes Free:	16104625648          (15.00GB)
Bytes InTrash:	1463813              (1.40MB)
Total Bytes:	16106127360          (15.00GB)

* Space used by Google Services *
Service                              Bytes                               
DRIVE                                0.00B                               
GMAIL                                1.40GB                              
PHOTOS                               174.83MB                            
Space used by all Google Apps        1.57GB                              

drive version 0.0.5

Linux Ubuntu Command Line Google Drive Quota

Additional Google Drive Clients for Linux OS

The Insyn provides you Google Drive usage together with all of its packs of additional and special options or features directly from your Linux-based device, too. Though, this program is paid and the price is 15 $. Once you pay it, you can enter your Google Drive account from the Linux device. The question here is whether it is really worth it to pay, when you can actually get the same benefits from apps like Dropbox or SpiderOak. Both work on Linux and what is better here is that they are free.

On the other side, the Grive is also an open-source Google Drive customer. The problem here is that it is still in its beta stage and most experts in the field claim that sooner updates aren’t expected. Though, the Grive provides you special features such as desktop integration for the command-line program, for instance.
Linux customers definitely still remember the annoying Unreal Tournament 3 case. We remind you that the Epic Games Company has founded a good way to support Linux customers with the old Unreal Tournaments game, but the big hope was the audience of Linux to see the Unreal Tournaments – third part. And you must remember that this case was delayed so many times that eventually ended up with a failure and Linux still did not get what they were promised to.

So if you have been waiting for the Google Drive for Linux only as a regular Linux customer, probably, you are lucky, because there are so many other apps, programs and software types that still wait for the Linux update, but cannot even hope for having them soon.

Related Posts Plugin for WordPress, Blogger...

  • Attila Kovacs

    Hi There,
    thanks for the detailed guide, I have tried to use on the latest ubuntu server it but it does not create drive binary to run. Any idea?

  • Simon

    Any idea on how to setup a crontab to keep the folder synced? I’m trying to get it going on my raspberry pi with no luck.

  • Night Light (Akbar)

    how do we upload files to google drive by copy paste to the google drive folder , without using the web based method.

  • RonJohn

    Lots of errors when building it on Ubuntu 14.04, since it now requires go v1.3.

  • Krzysztof Jarzębski

    Ubuntu 14 distribution packages has go version 1.2, that’s too old for the current drive client. I was able to install 1.5 and 1.6 from binary packages,. Use i386 32-bit packages, Amd64 packages are not working.

    with go 1.5 i386 it’s working great.

    Great post. Helped a lot to migrate pictures from Dropbox to Google Drive / Photos. Thanks.