All your Google Drive needs in Linux, straight from the CLI

I recently found myself in need of a Google drive client that works in Linux and i think i've found the perfect one. The tool is drive and works straight from the CLI and only requires Golang.

Using drive is simple, create a directory in which you will sync your Google drive content. Then simply run the following command to initiate the connection between drive and your account:

drive init ~/Drive

Here is some basic commands to get you started using drive, to download a folder you'd use the pull option:

drive pull Pictures

The above command would pull the content of the folder Pictures inside the local Drive folder.

If you only want to pull the pictures that are inside of the Pictures folder, you'd use the depth option.

drive pull -depth 1 Pictures would only pull the contents of the Pictures folder, not the folder itself.

If you want to upload a file that you've added to your local Drive folder, you'd use the push option.

drive push Pictures/T-rexes

That would push any new files that were added to the T-rexes folder. To avoid the prompt for confirmation for each file, use the -quiet option.

To remove a file both locally and remotely, use the trash option.

drive trash test

That was a super quick introduction to drive and it's basic usage.