Search folders at specific/specifiable level in a tree

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
kazzybash
Posts: 110
Joined: Mon Mar 02, 2020 9:55 pm

Search folders at specific/specifiable level in a tree

Post by kazzybash »

hi,

was searching for an Everything-function connected to this one here: viewtopic.php?f=5&t=9740

I am looking for a way to display folders exclusively on a specified depth of level (not first level per se). Say I have this drive E:\ with the deepest nesting at level five, then I want to be able to see folders at, say, level 4 ONLY and not at any other level.

I found out this is possible with powershell: Get-ChildItem E:\*\*\* -Directory

whereby the number of \* in the command determine the level depth.

Powershell is another 'tool' and this command produces an as yet unworkable list. I would like this function in a gui, preferably in Everything :lol: .

Any suggestions as to how to produce such an advanced search?

Kind regards, kazzy
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Search folders at specific/specifiable level in a tree

Post by NotNull »

You mean the depth: function or it's alias parents: ?
Everything Search Syntax wrote:depth:<count>
parents:<count> Search for files and folders with the specified folder depth.
kazzybash
Posts: 110
Joined: Mon Mar 02, 2020 9:55 pm

Re: Search folders at specific/specifiable level in a tree

Post by kazzybash »

hi NotNull,

thanks for your kind reply. I am not sure if I understand you correctly.

I was not referring to any function I knew of, but to something I wish to accomplish with a search and management tool (preferably Everything :P ). Total Commander has a function to search for folders up to a specific and specifiable depth in the hierarchy (say 'search no deeper than level 3'), but does thereby not exclude higher levels.

I tried the syntax from your reply 'depth:' and 'parents:' but they did not yield anything other than the top folder levels (being my harddisks).

Kind regards, kazzy
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Search folders at specific/specifiable level in a tree

Post by NotNull »

depth:2 will find "C:\Windows\notepad.exe"
depth:>2 will find "C:\Windows\System32\cmd.exe"
depth:>=2 will find both

You can also use depth:<3. etc.

You can type these in the Everything search bar.


Please take a look at the Everything Search Syntax
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Search folders at specific/specifiable level in a tree

Post by raccoon »

another example of using depth to control the level of folder contents to search for. in this case, only folders of depth 3 to depth 4.

e:\music\ depth:3..4

e:\ <- depth 1
e:\music\ <- depth 2
e:\music\videos\ <- depth 3
e:\music\videos\mtv\ <- depth 4
kazzybash
Posts: 110
Joined: Mon Mar 02, 2020 9:55 pm

Re: Search folders at specific/specifiable level in a tree

Post by kazzybash »

hi both, thanks a lot for your reactions. What I am looking for is 'folder only' , I am (in this case) not interested in folder-contents. What I am looking for is a refinement in folder management which, as of yet, I have not been able to find in any tool.

So I am looking for a way to display folders (not their contents) exclusively on a specified depth of level. Say I have this drive E:\ with the deepest nesting at level five, then I want to be able to see folders at, say, level 4 ONLY and not at any other level.

Any suggestions as to how to accomplish such a search?

Thanks and kind regards, kazzy
void
Developer
Posts: 16841
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search folders at specific/specifiable level in a tree

Post by void »

Please try the following search:

e: folder: depth:4

e: = limit results to your E: drive only
folder: = match folders only.
depth:4 = match files/folders with a depth of 4. (4 parents)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Search folders at specific/specifiable level in a tree

Post by raccoon »

Slap on the folder: filter to any search query to display only folders.

e:\music\ depth:3..4 folder:
or
e:\music\ folder: depth:3..4
or
depth:3..4 folder: e:\music\

edit: @void types faster than me.
kazzybash
Posts: 110
Joined: Mon Mar 02, 2020 9:55 pm

Re: Search folders at specific/specifiable level in a tree

Post by kazzybash »

wow guys, this does the trick. Exactly what I needed, I mean, also in vivo. This works for the task I intended. Thanks a lot!!
Coldblackice
Posts: 79
Joined: Sun Jul 13, 2014 12:20 am

Re: Search folders at specific/specifiable level in a tree

Post by Coldblackice »

Is it possible to have "depth:" work relative to the folder being searched? So if I have C:\test1\test2\test3 on my drive and I search for "\test2\" in the search, appending "depth:1" would be relative to the depth of test2, and not from the root of the drive.
void
Developer
Posts: 16841
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search folders at specific/specifiable level in a tree

Post by void »

Awkward to do with Everything 1.4, please try:

*\test2\* !*\test2\*\*

and if you wanted a depth of 2:

*\test2\*\* !*\test2\*\*\*




Everything 1.5 makes this easy with the following search:

test2\*

and if you wanted a depth of 2:

test2\*\*
Coldblackice
Posts: 79
Joined: Sun Jul 13, 2014 12:20 am

Re: Search folders at specific/specifiable level in a tree

Post by Coldblackice »

void wrote: Sat Jul 30, 2022 7:34 am Awkward to do with Everything 1.4, please try:

*\test2\* !*\test2\*\*

and if you wanted a depth of 2:

*\test2\*\* !*\test2\*\*\*




Everything 1.5 makes this easy with the following search:

test2\*

and if you wanted a depth of 2:

test2\*\*
Wow, that's a fantastic trick, and one I'll be using frequently now, no longer having to guess-iterate via "parents:0..n" :D
Post Reply