55

In Google Drive, is there a way to search only the contents of files within a particular folder (instead of files within the entire drive, as is the default)?

  • It doesn't look that way, no. You can filter by owner, date, sharing status; but not by folder. – ale Feb 4 '13 at 18:01
  • 6
    Try the in:folder_name operator (e.g. in:folder_name search_term. Found here. – Alex Feb 4 '13 at 18:02
  • 1
    @Alex yes, why not add that as an answer, it's what I would have suggested :) – OnenOnlyWalter Feb 4 '13 at 18:05
  • 5
    @Alex Sorry, I just tried what you said, but apparently it doesn't work (no results even when I know the file is there). – Hydra Feb 5 '13 at 11:00
  • 2
    What's funny is that if I search and Google Docs says "documents found in Trash" and I click "view" it shows me "<docname> in:Trash" but if I do that search....it returns NO RESULTS. Geesh... Google. WTF? – Clay Nichols Oct 29 '13 at 18:45

14 Answers 14

9

Google just announced that now they included a the search within folder feature.

From the above link:

You can now search for content in a specific folder in Google Drive. Select the drop-down in the search bar and choose the folder you want from the Location menu, or right-click on a folder and search within that folder. Only folders that are within your My Drive or within Team Drives can be searched; if you have a folder that is shared with you, first add the folder to your My Drive.

10

As of the date of this post, Google Drive does not support searching within a specific folder. However, the new Docs, Sheets, and Slides home screens do have a way to let you do this via the File Picker search interface:

  • Go to: https://docs.google.com

  • Click the File Picker folder icon on the right side of screen.

  • Navigate to the specific folder that you want to search.

  • Now put your query term in the file picker's search box and hit 'Enter' (Or click the 'Search for all items containing ')

Your search results will only come from the folder you selected.

Note: you can still filter by file type in the File Picker search bar by clicking the drop down arrow.

  • 1
    why doesn't drive search show you the containing folder name? – SuperUberDuper Dec 16 '15 at 18:23
  • 1
    This is a rather convoluted way of doing it and ignores people who mostly use drive.google.com. Obviously the view count of this page shows that missing folder searching in their interface was very short sighted on Google's part. Sigh. – deltaray Sep 7 '16 at 18:13
  • @deltaray I'm guessing somewhere at Google there is some risk analysis regarding features, e.g., cost of implementing+maintaining a feature vs benefit in data acquisition. – Fuhrmanator Nov 1 '16 at 15:12
  • Unfortunatelly, this doesn't search subfolders nor does it allow wildcards / requires full keyword. For illustrations and more details: quora.com/… – cregox Dec 3 '16 at 8:40
  • 1
    @SuperUberDuper This can (now) be seen by, after entering your search query in drive search, hitting enter, selecting the file below the search bar and viewing the details of the file (icon that looks like an "i", then choose the details tab (as opposed to the activity tab)). If the file has a parent (location) it will be listed there next to the folder icon. – Jacob Akkerboom Feb 13 at 13:12
9

Simply star the folders or particular files that you wish to search and then search "is:starred". Unstar them once you want to search something else. It's a little impractical, but it's what I do to search my journal articles, 1000s of which I've stored on my Drive.

3

A time-consuming work around, which isn't so painful if there are just a few folders you want to search, is to share those folders with other Google accounts, and then include to: thatgoogleaccount@example.com in your search.

The script in user165768's answer also works. It asks you to share a scary bunch of permissions, so you may want to look at the code at https://github.com/ljv5555/drive-folder-search/tree/gh-pages/app to reassure yourself, and possibly make your own copy.

2

I wrote an app to search by folder (within file contents). It is a bit slow so be patient when it is loading.

https://script.google.com/macros/s/AKfycby6G32K-vKCiLmoKvMtG64cYPHEREEx1PY5IoYrEYaR6WAfbXs/exec

  • too bad it's 3 years old and doesn't seen to work anymore! :( – cregox Dec 3 '16 at 8:37
2

You can take a look to the following tool: www.evenbytes.com/metadrive.html

This tool will help you to search within Google Drive Folders. In addition to that, the tool provides additional features such as filters or custom metadata.

  • When I try to "install" it, it prompts me to create a Google Apps for Work account. – Clay Nichols Aug 19 '15 at 21:58
  • Dead link (...) – Dan Aug 26 '17 at 12:32
2

I have written a simple Python script that can tag your files with folder, after which you can easily search by folder just by typing folder:folder_name or folder:absolute_path. You can get my code from here: https://github.com/songxf/drive-search-by-folder

  • so, it basically adds the folder path into description, pre appended by "SBFTK:folder:", and replaces it for when you move files around and run again, right? not too shabby! but what is sbftk? – cregox Dec 3 '16 at 10:27
  • @cregox My guess: sbftk is search by folder something something, maybe search by folder tag something. – Larry Engholm Jan 26 '17 at 19:29
1

I don't think there is such a feature available in Google Drive yet, but you can do a workaround.

If you do not intend to search for files recursively, simply just open the folder you want to search in and use the browser function (Ctrl+F) to search the name of your desired file.

Of course using this method you can't search within the file itself for text matches.

  • 2
    Yes, unfortunately I want to search content within files, not just filenames. I'm also looking to be able to recursively search within a folder (including subfolders). Thanks for the suggestion, though! – Jon Schneider Feb 11 '13 at 21:42
1

There is another workaround that does not require any third party app or extension.

  • Remove your folder (in which you wanna search something)
  • Search with is:trashed filter. For example: is:trashed query_string
  • Restore your folder back
  • For me, this only finds FOLDERS that are trashed, but not anything WITHIN those folders. – Dan Aug 26 '17 at 10:48
1

One solution: gdrive, which is a CLI for Google Drive.

To find items in a given folder, you use

gdrive list -q "'folderID' in parents"

To get the folderID, navigate to the folder in GDrive, then from the URL copy the ID, e.g., if I go to my folder "Pictures" the URL is
https://drive.google.com/drive/u/8/folders/0B1FVU07aR9pFcDhFbUdkdhF9Oam8

So the folderID is 0B1FVU07aR9pFcDhFbUdkdhF9Oam8

gdrive allows you to use all the search capabilities of the API which are far more robust than the GUI.

However, this doesn't seem to be recursive, i.e., it only finds direct children of the given folder, not anything deeper.

What's interesting, and worth exploring, is that if I use a folderID and search from the GUI like "in:0B1FVU07aR9pFcDhFbUdkdhF9Oam8" then Google Drive shows the correct name of the folder almost like a filter in the GUI!

enter image description here

But it does NOT really work; I cannot find anything in the folder, and the GUI shows this error at the bottom of the screen:

enter image description here

Maybe someone can figure out a way to get this to work as expected.

1

Search within a folder is now available as of January 2018.

You can right-click on a folder name and Select 🔍 Search within folder_name and it'll let you do so from the search bar of Google drive.

You can right-click on a folder from:

  • Left navigation panel
  • Folders inside My Folder
  • Upper navigation helper
  • Folder from 'Shared with me'
  • Second level folders from one of your synced 'Computers'
0

If you want to search for text inside the files, you could search your drive for the text, then use (Ctrl+F) to search for the folder name. A little messy, though, and again, not recursive!

0

I have had very inconsistent success with:

in:<foldername>

This is somewhat inconsistent though.

This is how Google lets you search your Trash: e.g. before:2013-06-01 in:Trash

0

Another solution – if you have a G Suite account – is to use a Team Drive. You can create a new Team Drive, not share it with anyone, and move folders into it. Then you can narrow your search to only the Team Drive.

enter image description here

protected by Community Nov 27 '18 at 23:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.