LinuxAndUbuntu - Linux News | FOSS Reviews | Linux Tutorials HowTo
  • Home
    • Linux >
      • Ubuntu
      • Linux Mint
      • Fedora
      • Arch Linux
      • Open Suse
      • Other Linux Distros
  • Linux Store
  • Video Tutorials
  • Linux Themes
  • FAQs
  • Advertise
  • Contact Us
  • Block Adblock
  • Favorites
  • Ubuntu Releases
  • Linux Mint Releases

Google Drive Linux CLI Client

16/1/2017

Comments

 
Google Drive Linux CLI Client
Google Drive is one of the most popular services to store your files in the cloud. You can access your Google Drive account through a web browser or using a client. This time I’m going to talk about one Google Drive Linux client but without a graphical interface. In this tutorial, you’re going to know how to use a client through the command line interface to access, download and upload to your google drive.

​Gdrive A Google Drive Linux CLI Client

The client that we’re going to use is called Gdrive, a Google drive Linux CLI client. You can get Gdrive easily, just follow the link below and download the appropriate version for your system, it can be installed on Windows, Mac OS X and obviously on Linux.
​
GDrive Official GitHub Page: https://github.com/prasmussen/gdrive

For example, I’ve downloaded the 64 bits Linux version:
download gdrive for linux 64-bit
When the download is done, you can use it.

How To Use Gdrive?

First, you must make sure that the file has executable permissions, so, you can use the following command to give the correspondent permissions to the file.
$ chmod +x gdrive-*-*
how to use gdrive in linux
Now you must connect your account with gdrive. Just type the following command:
$ ./gdrive about
connect gdrive to google account in linux
Then you must go to the URL provided by Gdrive, just copy and paste it in your web browser and allow the permission for Gdrive. After that you will get a code for Gdrive, just copy and paste it in your terminal.
gdrive in linux varification code
Then you must go to the URL provided by Gdrive, just copy and paste it into your web browser and allow the permission for Gdrive. After that you will get a code for Gdrive, just copy and paste it in your terminal.
access gdrive in linux terminal
Now you can do many things with Gdrive, so let’s get started.

You can start listing the files of your account, just type:
$ ./gdrive-linux-x64 list
access google drvie from linux terminal
If you want to download a file you must find the correspondent Id and then just use the following command:
$ ./gdrive-linux-x64 download fileId
download gdrive file from linux terminal
If you want to download a Google Document, you must export and the download will be automatic:
$ ./gdrive-linux-x64 export fileId
download google document from linux terminal
Also, you can create a directory on your google drive account:
$ ./gdrive-linux-x64 mkdir directory
create directory in google drive from linux terminal
If you want to upload a file you can use the following command:
$ ./gdrive-linux-x64 upload file
upload files to google drive from linux terminal
Each action of Gdrive has many arguments, for example, the download option has the following arguments:

[global]
 -c, --config <configDir>
​ Application path, default: /Users/<user>/.gdrive
 --refresh-token <refreshToken>
 Oauth refresh token used to get access token (for advanced users)
​ --access-token <accessToken>
 Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
[options]
 -f, --force
 Overwrite existing file
 -r, --recursive
 Download directory recursively, documents will be skipped
 --path <path>
​ Download path
​ --delete
​ Delete remote file when download is successful
 --no-progress
 Hide progress
 --stdout
 Write file content to stdout
​ --timeout <timeout>
​ Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300
The complete syntax of download is: gdrive [global] download [options] <fileId>

If you want to know more about how to use Gdrive and its options, you must read the complete documentation, it’s available on the official GitHub web page of Gdrive.

Conclusion

You have many options to use Google Drive: The browser, GUI Clients, and command line clients. If you are a terminal lover or you need use advanced options of Google Drive, Gdrive is for you. It has more advanced options like manage revisions of a file. You have the final decision, choose the better option for your needs.​


Related articles
Comments
comments powered by Disqus

    Most Read Articles

    5 Lightweight Linux For Old Computers
    20 Best Themes For Ubuntu In 2017

    8 Best IDEs Or Code Editors For Linux
    8 Best IDEs Or Code Editors For Linux

    3 best twitter clients for linux
    [How To] Install Latest NVIDIA Drivers In Linux

    Ubuntu Vs. Linux Mint - Which Is Better in 2016?
    5 Lightweight Linux For Old Computers

    dual boot ubuntu and windows
    10 Basic Linux Commands That Every Linux Newbies Should Remember

    dual boot ubuntu and windows
    6 Best Linux Distributions For Programming


    Translate Our Site



    Notice : Please be careful, after translation commands will change.

    This website uses marketing and tracking technologies. Opting out of this will opt you out of all cookies, except for those needed to run the website. Note that some products may not work as well without tracking cookies.

    Opt Out of Cookies

About LinuxAndUbuntu

​​LinuxAndUbuntu.com  focuses on open source projects but  specific on debian based distributions. We also give value to other linux distributions.

Links

Ubuntu.com
Video Tutorials
Tutorials & HowTos
Privacy Policy
Contact us

Like Us

More From LinuxAndUbuntu

Contribute  Your Work
Advertise

RSS Feed

Picture
Ubuntu is a registered trademark of  Canonical Ltd.

Any material in this site can not be reproduced without permission.
  • Home
    • Linux >
      • Ubuntu
      • Linux Mint
      • Fedora
      • Arch Linux
      • Open Suse
      • Other Linux Distros
  • Linux Store
  • Video Tutorials
  • Linux Themes
  • FAQs
  • Advertise
  • Contact Us
  • Block Adblock
  • Favorites
  • Ubuntu Releases
  • Linux Mint Releases