February 21, 2024

Uploading Files from Linux to Google Drive using gdrive

If you're looking to upload files from Linux to Google Drive, the gdrive tool provides a convenient solution. Follow these commands to set up and use gdrive for file management on Google Drive.

// Download gdrive
wget https://docs.google.com/uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA&export=download

// Rename the downloaded file
mv uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA gdrive

// Make gdrive executable
chmod +x gdrive

// Install gdrive to /usr/local/bin
sudo install gdrive /usr/local/bin/gdrive

// List files on Google Drive (Authentication needed)
gdrive list

Upon running gdrive list, you'll receive a message prompting you to authenticate. Follow the provided URL in your browser, log in to your Google account, and copy the verification code. Paste the code into the terminal to complete the authentication process.
After authentication, you can use various commands for file operations. Here are some examples:
Explore the power of gdrive commands for seamless file management on Google Drive. Learn how to upload, list, download, and create directories using these simple yet powerful commands.

// Upload a file
gdrive upload file.zip


// List files
gdrive list


// Download a file (Replace FILE_ID with the actual file ID)
gdrive download FILE_ID


// Create a directory
gdrive mkdir "New Directory"

Make file management on Google Drive efficient with these gdrive commands. Upload, list, download, and create directories seamlessly from your terminal.