Google Drive Search for Files and Folders

G
Published in: Google Drive

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.

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Google Drive

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
A
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account
G

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube