Upload a file to Google Drive using gdrive

Steps

Quick tip on using gdrive to upload to Google Drive:

gdrive upload <path-to-local-file>

e.g.

gdrive upload mydir/myfile.txt

This uploads the file to the home directory on Google Drive which is My Drive

To upload to a specific directory, do the following:

List the directories on Google Drive showing directory ids:

gdrive list

Obtain the directory id for the directory you wish to upload to.

Then do

gdrive upload --parent <id> mydir/myfile.txt

to upload the file to the directory in question

You can also search for specific folder in Google Drive by doing:

gdrive list -q "name contains 'BigData'"

References

Google Drive CLI Client