Google Drive is one of the most popular cloud file storage services. You can access your account Google drive via web browser or client. This time I will be talking about one Google Drive client but no GUI, in this tutorial you will know how to use the client through the command line interface to access, download and install to your Google Drive. The client we will be using 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 Linux.
GDrive Official GitHub Page: https://github.com/prasmussen/gdrive
For example, I downloaded on 64 bit Linux:
When the download is done, you can use it.
How do I use Gdrive?
First, you need to make sure the file has executable permissions, so you can use the following command to give the file permissions.
$ chmod +x gdrive-*-*
You should now link your account to GDrive. Just enter the following command:
$ ./gdrive about
Then you need to go to the URL provided by Gdrive, just copy and paste it in your web browser and allow permission to Gdrive … After that you will get the code for Gdrive, just copy it and paste it in your terminal.
Now you can do a lot of things with Gdrive so let’s get started.
You can start listing your account files, just enter the following command:
$ ./gdrive-linux-x64 list
If you want to download a file, you must find the contributor ID and then simply use the following command:
$ ./gdrive-linux-x64 download fileId
If you want to download a Google document, you must export and the download will start automatically:
$ ./gdrive-linux-x64 export fileId
Alternatively, you can create a directory on your account Google drive :
$ ./gdrive-linux-x64 mkdir directory
If you want to download a file, you can use the following command:
$ ./gdrive-linux-x64 upload file
Each Gdrive action has many arguments, for example, the boot option has the following arguments:
[global]
-c, –config |
Default Application Path: /Users/ |
–Refresh-token |
Token refresh OAuth is used to get an access token (for advanced users) |
–Access-token |
OAuth access token, only recommended for short lived requests due to short lifetime (for advanced users) |
[options]
-f, –force |
Replaces existing file |
-r, -recursive |
Download catalog recursively, documents will be skipped |
–Path |
Download path |
–Delete |
Delete deleted file on successful download |
–No-progress |
Hide progress |
–Stdout |
Write file contents to standard output |
–Timeout –timeout |
Set timeout in seconds, use 0 for timeout. Timeout is reached when no data is transmitted in a certain number of seconds, default: 300 |
Full boot syntax: gdrive [global] download [options]
If you want to know more about how to use Gdrive and its options, you should read the full documentation, it is available on the official GitHub site from Gdrive.
Output
You have many options to use Google Drive: browser, graphical clients and command line clients if you are a terminal lover or need to use additional options Google drive , Gdrive is for you, it has more advanced options for how to manage edits for a single file. You have the final decision to choose the best one for your needs.