Unlike Windows on Ubuntu’s latest versions such as 20.04 LTS, we don’t need to install any extra software to connect and use Google Drive account. Everything there and we just need to login to Ubuntu using a Google account.
Brief: While Google Drive is not officially available for Linux, here are tools to help you use Google Drive in Linux. Google Drive is an integral part of the Google ecosystem. It offers 15 GB of free storage which is shared across your Gmail account, Google Photos, various Google and Android services. There is no official client of Google Drive for Linux based OSes, you can use grive/grive-tools though. Sudo add-apt-repository ppa:thefanclub/grive-tools sudo apt-get update sudo apt-get install grive-tools Then search for grive in the dash and follow the installers instructions.
One of the popular public cloud services to store data is Google Drives because of free 15 GB storage. Most of the time to use that we visit Google Drive’s website to upload and download files, however, you can save your time by access G – Drive storage directly on your machine like any other network drive. However, there is no official client from Google for Linux systems, well, still we can use it using the default GNOME Online Accounts feature available on Ubuntu and other Linux systems.
Contents
1. Open Settings
Go to Ubuntu Settings, you can search for it in Applications or directly click on the drop arrow given right top side top access the Power Menu.
Officially, Open Drive is available for Ubuntu and Debian via a DEB package, Fedora, and OpenSUSE via an RPM, as well as a Snap package, and AppImage. To start the installation of the application, press Ctrl + Shift + T or Ctrl + Alt + T on the keyboard to open up a terminal window. Enable snaps on CentOS and install Open Drive (Google Drive Client) Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully. Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.
2. Select Account
On the left side panel, you will find various options and one of them will be Accounts, select it to see further options.
![How To Install Google Drive On Linux How To Install Google Drive On Linux](https://static.loverslab.com/uploads/monthly_2018_08/Bare_Basics_04.thumb.png.9207982cf1ad22e3337d9bc5305693f4.png)
3. log in to Google Account
As Gnome Online Accounts offers various services to directly logged in from Ubuntu Linux, among them you will also find Google.
Note: If you couldn’t see Google online Account option then install it using the below-given commands in the terminal:
Click on it and enter your Gmail email address and password.
c
How to make ubuntu bootable. Click Allow to let Gnome online Account service to access your Google Account
Once the account gets connected, we can select what should get synced on the Ubuntu system.
4. Access Google Drive on Ubuntu 20.04
Finally, open File Manager on your Ubuntu Linux system, and on the left side area, you will see the connected Google Drive account represented using your Gmail Email ID. Click on it, to access all files available on your drive.
We can directly copy-past to sync or backup all the available files between the Ubuntu 20.04 Linux system and Google Drive.
So, in this way, you can access our Google cloud storage files on Ubuntu Linux without using any official client…
Uploading or Downloading a file – Google Drive Linux Client using GDrive
Maybe something people can use as additional storage space?? GDrive is a Google Drive Linux Client that no Unix Administrator or user can do without.
Whilst browsing around the net a few weeks ago I came across a tool that just grabbed my attention. On the face of it I wasnt sure how useful this would be, but I showed it to one of my clients just in case he found some business function where he could use it.
Anyway last week he came back to me as he wanted to share a file with multiple people so this tool seemed ideal to be able to do it.
Introduction to GDrive
Firstly this tool can be used across multiple flavours of Linux (I use Centos 6 normally), as well as raspberry pi, windows (not sure of the practical use for this…), and even Apple Mac.
Installing GDrive – Google Drive Linux Client
Simply download the latest version from their github page HERE
For my Centos 6 server I used this one : drive-linux-x64 v1.9.0
(right click and copy link url then paste into wget below)
wget -O /usr/local/bin/gdrive 'paste url here'
I copied the file into /usr/local/bin so it is globally available to all users on my server, and I also renamed it to gdrive juat as I thought that would be easier to remember !! Dont forget to make the file executable (chmod +x /usr/local/bin/gdrive) and thats it !!!
Configuring GDrive using your Google Drive Linux Client
When you first run any gdrive command it will prompt you to link it to your google drive account and give it permissions. Easiest way to do this is just to try and list the files on your Google Drive like this :
gdrive list
The program will then return with a url you need to link it to your account. Here is how I did it :
1) Open Chrome (or any browser) and log in to the Google account you want to link gdrive with
2) Make sure you can see in your apps Google Drive appearing (the menu in the top right is normally where it appears
3) Paste in the url from the output of the ‘gdrive list’ you did earlier, and accept the permissions prompt it needs to enable gdrive to upload and download files.
2) Make sure you can see in your apps Google Drive appearing (the menu in the top right is normally where it appears
3) Paste in the url from the output of the ‘gdrive list’ you did earlier, and accept the permissions prompt it needs to enable gdrive to upload and download files.
Once you have done all that then go back to your command line session and run the ‘gdrive list’ again. You should see a list of your files on Google Drive !!
First proper test of GDrive – Uploading a file – Google Drive Linux Client
Once again a very simple process. As example just copy your /etc/hosts file to Google Drive like this :
gdrive upload -f /etc/hosts
How damn simple is that !!!
How to go back in pdf. Run your ‘gdrive list’ again to see your file there. You can also see it in your browser if you are still logged in Google Drive (or log back in just to check then you know it all works!)
Downloading a file from Google Drive Linux Client with GDrive
Ok so you may have noticed when you did ‘gdrive list’ in the previous steps that each file has an ID? Do it again and you will see :
# gdrive list
Id Title Size Created
0B0tRrdcY7CwJZHh5ZmVpZHRMYW8 drive-linux-amd64 10 MB 2014-09-25 17:47:08
0B0tRrdcY7CwJY2lNS2x3NC1lQUU drive-linux-386 8 MB 2014-09-25 17:47:01
0B0tRrdcY7CwJR3lmZnlRaFZwOHc drive-linux-arm 9 MB 2014-09-25 17:46:57
0B0tRrdcY7CwJQlRfQUVxY2hkWUE drive-linux-rpi 9 MB 2014-09-25 17:46:52
So to download a file it is the ID you use and not the filename. Therefore just as simple this is how you download a file :
gdrive download -i 0B0tRrdcY7CwJZHh5ZmVpZHRMYW8
And thats it !! Are you falling in love with this program as much as I did?? (dont worry, I have got over it now…)
Sharing a file you have uploaded to Google Drive Linux using GDrive on the command line
The one part of this program that maybe could be improved in the future…. sure you can share a file, the only limitation at the moment is you can only share to EVERYONE, and not to specific people/emails.
Anyway here is how you do it. Same as the download option you need the file ID which you can get from the ‘gdrive list’ method :
gdrive share -i 0B0tRrdcY7CwJZHh5ZmVpZHRMYW8
Other functionality in GDrive – Google Drive Linux Client
There is a few other options in GDrive that are pretty cool ive listed below :
How to download new safari browser. – Delete a file from Google Drive
– Create a folder on your Google Drive (this folder can also be shared to everyone)
– Upload a file into a folder on Google Drive (using a parent ID of the folder)
– Create a folder on your Google Drive (this folder can also be shared to everyone)
– Upload a file into a folder on Google Drive (using a parent ID of the folder)
Not bad at all for a freebie !!!
Any comments or questions let me know, dont forget to share this post to others who may find it useful, and please check out my other Linux and Bash tips HERE and HERE
Google Drive Cli Linux
Related Posts
Linux Download Google Drive
- How to easily disable a wordpress plugin (2)
- How to test if lftp has worked in bash script (2)
- How to convert a wav to mp3 using ffmpeg (2)
- Linux Date Problem – 1 month ago date bug (2)
- Bash remove duplicate lines without sorting (2)
- Upgrade Plex Media Server (Centos, Ubuntu, Fedora) (2)
- How to stop people trying to hack your root logon (2)
- Install and configure Varnish 4 – Varnish Cache for WordPress (2)
- Nagios Systems Monitoring Application Review (2)
- How to Install MariaDB on Centos 6 (2)