FIrestore: Finding large files or directories

Viewed 106

I have a few hundred folders in my Firestorage bucket, each containing a couple of small images. However, my storage size is almost 80GB!

Is there a way to find the culprit files or folder? I can't seem to find a way to view folder sizes or get a list of the top largest files without causes a huge number of reads.

1 Answers

By using the gsutil command, you could try using the DU command:

gsutil du -sh YOUR_BUCKET/YOUR_DIRECTORY

The -s flag will give you only the size of the directory, if you remove it you will also see the size of the files inside. The -h flag prints object sizes in human-readable format (e.g., 1 KiB, 234 MiB, 2GiB, etc.)

You can then find out which files are the biggest.

Related