Google Drive Search for Files and Folders

The Google Drive Permissions Auditor add-on uses a Google Script to analyze who has access to your Google Drive files. You can use any of the search operators of the Google Drive API to query for files in Google Drive whose metadata match your search criteria.

1. Find all files in my Google Drive owned by me except those in trash

"me" in owners and trashed = false

2. Search for files that begin with the term “IMG”

name contains 'IMG'

The contains operator only performs prefix matching for a name. For example, the name “HelloWorld” would match for name contains ‘Hello’ but not name contains ‘World’.

3. Search files that contain the word “ctrlq” anywhere in the content

fullText contains 'ctrlq'

The contains operator only performs matching on entire string tokens for fullText. For example, if the full text of a doc contains the string “HelloWorld” only the query fullText contains ‘HelloWorld’ returns a result.

4. Find all image files modified since January 30, 2016

modifiedTime > '2016-01-01T12:00:00' and mimeType contains 'image/'

5. Find all audio & video files that are not owned by me

sharedWithMe and (mimeType contains 'video/' or mimeType contains 'audio/')

6. Search for files containing the text “important” and are in the trash

fullText contains 'important' and trashed = true

7. Search for all Google Sheets in Google Drive (Supported MIME Types)

mimeType = 'application/vnd.google-apps.spreadsheet'

8. Search for files where abc@example.com is an editor (writer)

'abc@example.com' in writers

9. Search files that do not contain the word “ctrlq” in the content

fullText not contains 'ctrlq'

10. Search files that are not JPG images

mimeType != 'image/jpeg'

If you need help with writing search queries, please contact the developer.

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 🫶🏻