Skip to toolbar

How to access your Google Drive account from the command line using RClone

How to access your Google Drive account from the command line using RClone

Install Rclone

sudo curl https://rclone.org/install.sh | sudo bash

rclone v1.50.2 has successfully installed. Now run rclone config for setup.

Check https://rclone.org/docs/ for more details.

Rclone Config

This will guide you through an interactive setup process using terminal but here is my quick option for reference.

rclone config

NOTICE: Config file ~/.config/rclone/rclone.conf not found – using defaults No remotes found – make a new one> n) New remote s) Set configuration password q) Quit config n/s/q>

n/s/q> n
name> remote

Type of storage

Type of storage to configure.

Enter a string value.

Press Enter for the default (y).

Choose a number from below, or type in your own value

storage > 13

Google Application Client ID

Setting your own is recommended.

See https://rclone.org/drive/#making-your-own-client-id for how to create your own.

If you leave this blank, it will use an internal key which is low performance.

Enter a string value.

Press Enter for the default (y).

client_id> Press Enter for the default (blank)

Google Application Client SecretSetting your own is recommended. Enter a string value. Press Enter for the default (y).

client_secret> Press Enter for the default (blank)

The scope that rclone should use when requesting access from drive.

Enter a string value. Press Enter for the default (y).

Choose a number from below, or type in your own value

scope> 1

ID of the root folder

Leave blank normally.

Fill in to access Computers folders (see docs), or for rclone to use a non root folder as its starting point.

Note that if this is blank, the first time rclone runs it will fill it in with the ID of the root folder.

Enter a string value. Press Enter for the default (y).

root_folder_id> 

Service Account Credentials JSON file path

Leave blank normally.

Needed only if you want use SA instead of interactive login.

Enter a string value.

Press Enter for the default (y).

service_account_file> 

Edit advanced config? (y/n) y) Yes n) No

y/n> n

Remote configUse auto config? *

Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes n) No

y/n> Y

If your browser doesn\’t open automatically go to the following link: http://127.0.0.1:53682/auth?state=F–string

**Log in and authorize rclone for access

****Waiting for code…

Got code

Configure this as a team drive?**y) Yes n) No

y/n> N

[remote] type = drive scope = drive token = {access_token:token_here y) Yes this is OK e) Edit this remote d) Delete this remote

y/e/d> y

Current remotes:

Name Type ==== ==== remote drive e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config

e/n/d/r/c/s/q> q

Usage

rclone lsd remote:
rclone ls remote:

Drive Information

Total: 30G
Used: 12.040G
Free: 12.218G
Trashed: 368.858M
Other: 5.742G

rclone about remote: