Thursday, 12 November 2026

Quick & Dirty Tutorial: How to download files from Google Drive using wget

 1. Set Up File Sharing Permissions

Before using wget ensure that the file you want to download is shared correctly:

  • Right-click on the file in Google Drive.
  • Select "Share."
  • Change the sharing settings to "Anyone with the link" can view or download the file.

2. Obtain the File ID


You need the file ID from the Google Drive link. The file ID is the part of the URL that looks like this: 1yXsJq7TTMgUVXbOnCalyupESFN-tm2nc
  • Right-click on the file in Google Drive.
  • Select "Share."
  • Select "Copy Link"
  • Paste into a text editor and isolate the FILE_ID

3. Download file using wget


From here there are several ways to use wget, but the only one that seems to reliably work is to bypass all of the potential confirmations (large file, virus scan etc) is to use the endpoint directly (Replace FILE_ID of course):

wget -c --content-disposition \  "https://drive.usercontent.google.com/download?id=FILE_ID&export=download&confirm=t"
That's it. Of course, as always, YMMV.