Create a Tree View of your Google Drive

If you have ever worked with DOS or Linux before, you’ll be familiar with the “tree” command that recursively lists all the files and folders in the current directory in a tree like format. Most of us prefer visual navigation through Windows Explorer or Mac Finder but a unique advantage with the tree command is that you can save and print the directory structure.

Google Drive - Folder Tree

Tree Command for your Google Drive

I have written a little Google Script that is much like running “tree” but against your Google Drive. It creates a hierarchical tree diagram of all the files and folders in your Google Drive that you can save for offline reference or even print.

To get started, click here and authorize the script to access the files in your Google Drive. Once the authorization is complete, it may take a minute to generate the entire Google Drive tree. You’ll then get a link to download an HTML file that mirrors your Drive structure. You can directly send the file to the printer as well.

Internally, all the script does is recursive traversal and the tree itself is sylized through simple CSS. In the current version, only the folder names in the tree are linked to their corresponding location in your Google Drive though the script can be easily extended to create a more data-rich tree that includes details like file URLs, sharing permissions, file sizes, file types and so on.

The process may take slightly longer if you have a large drive with tons of file and folders. Also, as soon as you authorize the Google Drive Tree script, you’ll get an email from Google with instructions on how to revoke access. You can do so as soon as the tree has been generated.

Amit Agarwal is a web geek, solo entrepreneur and loves making things on the Internet. Google recently awarded him the Google Developer Expert and Google Cloud Champion title for his work on Google Workspace and Google Apps Script.

Awards & Recognition

Google Developer Expert

Google Developer Expert

Google awarded us the Developer Expert title recogizing our work in Workspace

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional title for 5 years in a row

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator award for technical expertise

Want to stay up to date?
Sign up for our email newsletter.

We will never send any spam emails. Promise 🫶🏻