I would like to just upload files to google drive from the command line. I don't care about synchronisation. I just want to upload things to google drive and if they exist they get replaced if not they are created.

I know grive exists but that syncs everything from google drive to the folder you use which isn't what I want.

I was wondering if there is a solution to this, through scp or something similar?


  • 3
    scp and rsync use ssh. AFAIK Google Drive doesn't offer ssh. rsync can also connect to a rsync daemon, but I doubt Google Drive offers that as well. AFAIK they don't even offer FTP, so probably the only way is creating a script using cURL. – Alex Apr 20 '14 at 19:03
  • which kind of "hacks" it's way through the browser interface? – evan54 Apr 20 '14 at 19:04
  • 1
    you can check this out github.com/prasmussen/gdrive – Oki Erie Rinaldi Jun 17 '17 at 7:07
  • 2
    I just do ./gdrive-linux-x64 upload yourfile.rar. And Then yourfile.rar will be uploaded to your gdrive home folder – Oki Erie Rinaldi Jun 17 '17 at 7:08
  • The service Couchdrop.io acts as middleman and is free up to 1GB – brasofilo Dec 31 '18 at 5:38

send the file to your gmail account as attachment and from there you can save it to google drive directly.

uuencode file.txt file.txt | mail your_email@gmail.com

I know this is not direct to gdrive, but as there is no other options available I use this easy approach.

  • 2
    Nice trick, pity that's not exactly what's being asked. I need to send a big file and email attachments are restricted to 25MB – brasofilo Dec 31 '18 at 5:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.