How to calculate the size of Google Drive folders

— 1 minute read

I was reaching my storage capacity for Google Drive and great was my surprise that you cannot see the size of folders in the user interface.​

You can however, see how much space your folders take using the following procedure:

  1. Go to https://colab.research.google.com/

  2. Create a new notebook

  3. Click the Files icon and then click Mount Drive

    Mount your Google Drive
    Mount your Google Drive

  4. Copy the following in a cell and click the play icon

! cd /content/drive/MyDrive/ ; du --apparent-size -csh * | sort -rh

Google Drive folder sizes
Google Drive folder sizes

Depending on the total size, this may take a while. It's also possible that some folders report 0 but that's likely because the script timed out. You can change the path from /content/drive/MyDrive/ to a specific folder like /content/drive/MyDrive/Photos to see the size breakdown of that folder.