Google Drive is one of the most popular services to store your files in the cloud. You can access to your Google Drive account through a web browser or using a client. This time I’m going to talk about one Google Drive client but without 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.
The client that we’re going to use is called Gdrive. 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:
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-*-*
Now you must connect your account with gdrive. Just type the following command:
$ ./gdrive about
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.
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.
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
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
If you want to download a Google Document, you must export and the download will be automatic:
$ ./gdrive-linux-x64 export fileId
Also, you can create a directory on your google drive account:
$ ./gdrive-linux-x64 mkdir directory
If you want to upload a file you can use the following command:
$ ./gdrive-linux-x64 upload file
Each action of Gdrive has many arguments, for example, the download option has the following arguments:
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.
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.