Google Drive folder with Bash Windows

  • 8 months ago
Comment

ChatGPT
1 / 1

To interact with a Google Drive folder using Bash on Windows, you can use the gdrive command-line tool. gdrive is an open-source tool that provides command-line access to Google Drive. Here's how you can set it up and use it:

  1. Install gdrive:
    Download the gdrive binary for Windows from the releases page: https://github.com/gdrive-org/gdrive/releases
    Extract the downloaded archive and move the gdrive.exe executable to a directory in your system's PATH.

  2. Authenticate gdrive:
    Open a Command Prompt or PowerShell window, and run the following command to authenticate gdrive with your Google account:

    bash
    gdrive about

    This will prompt you to authorize the tool and generate an authorization token.

  3. List Files and Folders:
    To list files and folders in your Google Drive, you can use the following command:

    bash
    gdrive list
  4. Upload a File:
    To upload a file to your Google Drive, use the following command:

    bash
    gdrive upload /path/to/your/file
  5. Download a File:
    To download a file from your Google Drive, use the following command:

    bash
    gdrive download fileID

    Replace fileID with the actual ID of the file you want to download.

  6. Create a Folder:
    To create a folder in your Google Drive, use the following command:

    bash
    gdrive mkdir "Folder Name"
  7. Move Files and Folders:
    You can move files and folders within your Google Drive using the gdrive command. Refer to the tool's documentation for specific usage.

  8. Share Files and Folders:
    To share files or folders with specific permissions, use the gdrive share command. Refer to the tool's documentation for detailed instructions.

Please note that while gdrive provides a convenient way to interact with Google Drive from the command line, it's an external tool and not an official Google product. Make sure to review the tool's documentation and be cautious when granting access to your Google account.

For more detailed information about using gdrive, you can refer to the project's GitHub repository: https://github.com/gdrive-org/gdrive